[PATCH 96/99] cw1200: Do not allow device to suspend when it is not fully awake.

Dmitry Tarnyagin dmitry.tarnyagin at stericsson.com
Wed Feb 29 14:15:43 UTC 2012


Patch fixes a race between device wakeup and device_suspend. The race
might confuse state machine in firmware.

ST-Ericsson ID: 419543

Change-Id: I07fa22879b3735fe4d5a1f70f5660a693a1b0211
Signed-off-by: Dmitry Tarnyagin <dmitry.tarnyagin at stericsson.com>
---
 drivers/staging/cw1200/bh.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/cw1200/bh.c b/drivers/staging/cw1200/bh.c
index 1acc972..fe8ecc1 100644
--- a/drivers/staging/cw1200/bh.c
+++ b/drivers/staging/cw1200/bh.c
@@ -292,7 +292,8 @@ static int cw1200_bh(void *arg)
 				rx = atomic_xchg(&priv->bh_rx, 0);
 				tx = atomic_xchg(&priv->bh_tx, 0);
 				term = atomic_xchg(&priv->bh_term, 0);
-				suspend = atomic_read(&priv->bh_suspend);
+				suspend = pending_tx ?
+					0 : atomic_read(&priv->bh_suspend);
 				(rx || tx || term || suspend);
 			}), status);
 
-- 
1.7.8.3



More information about the kernel mailing list