From 5e3608c5921fdc5c1f4799fcce4b80459a3367fa Mon Sep 17 00:00:00 2001 From: Michal Kazior Date: Wed, 29 Feb 2012 15:15:17 +0100 Subject: cw1200: fix scan timeout issues * send stop-scan to FW on scan timeout to ensure we don't send another start-scan while the other is yet to finish * abort the whole scan on timeout to avoid deadlock also notify the upper layers of scan cancelation `cancel_delayed_work_sync` would get called from within a workqueue worker `cw1200_scan_timeout` causing a deadlock. ST-Ericsson ID: 398988 ST-Ericsson FOSS-OUT ID: NA Change-Id: I78b8d3bf88730bc9e1ba81d05e65cdf7b568e6e9 Signed-off-by: Michal Kazior Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/42484 Reviewed-by: Bartosz MARKOWSKI Tested-by: Bartosz MARKOWSKI --- drivers/staging/cw1200/scan.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/staging/cw1200/scan.c b/drivers/staging/cw1200/scan.c index 32faf2b1c3f..8a113463c91 100644 --- a/drivers/staging/cw1200/scan.c +++ b/drivers/staging/cw1200/scan.c @@ -155,7 +155,11 @@ void cw1200_scan_work(struct work_struct *work) !(priv->powersave_mode.pmMode & WSM_PSM_PS)) cw1200_set_pm(priv, &priv->powersave_mode); - if (priv->scan.req) + if (priv->scan.status < 0) + wiphy_dbg(priv->hw->wiphy, + "[SCAN] Scan failed (%d).\n", + priv->scan.status); + else if (priv->scan.req) wiphy_dbg(priv->hw->wiphy, "[SCAN] Scan completed.\n"); else @@ -313,6 +317,8 @@ void cw1200_scan_timeout(struct work_struct *work) "Timeout waiting for scan " "complete notification.\n"); priv->scan.status = -ETIMEDOUT; + priv->scan.curr = priv->scan.end; + WARN_ON(wsm_stop_scan(priv)); } cw1200_scan_complete(priv); } -- cgit v1.2.3