diff options
author | Michal Kazior <michal.kazior@tieto.com> | 2012-02-29 15:15:17 +0100 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 11:06:46 +0200 |
commit | 5e3608c5921fdc5c1f4799fcce4b80459a3367fa (patch) | |
tree | 567c6c73de04e1c647baa00dbac3970559bbeb7d | |
parent | 0df82895afa0986680c874f33cbc70dfc61cc976 (diff) |
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 <michal.kazior@tieto.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/42484
Reviewed-by: Bartosz MARKOWSKI <bartosz.markowski@tieto.com>
Tested-by: Bartosz MARKOWSKI <bartosz.markowski@tieto.com>
-rw-r--r-- | drivers/staging/cw1200/scan.c | 8 |
1 files changed, 7 insertions, 1 deletions
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); } |