summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/zd1211rw
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>2011-01-31 21:50:02 +0300
committerJohn W. Linville <linville@tuxdriver.com>2011-02-05 00:29:51 +0300
commit3985a46543d47a50b94e839e0a16e67d959ab092 (patch)
tree07bfa1b8a9556fabf302b837df8763d9391005d4 /drivers/net/wireless/zd1211rw
parenta0fd751f0924e0eefa36592f1d358c4ab18b44c5 (diff)
downloadlinux-3985a46543d47a50b94e839e0a16e67d959ab092.tar.xz
zd1211rw: reset device when CR_BCN_FIFO_SEMAPHORE freezes in beacon setup
When driver fails to acquire device semaphore lock, device usually freezes soon afterwards. So failing to acquire lock indicates us that not everything is going right in device/fw. So reset device when this happens. Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/zd1211rw')
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index a590a94cb6fa..beaa969f7426 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -703,7 +703,7 @@ static int zd_mac_config_beacon(struct ieee80211_hw *hw, struct sk_buff *beacon)
dev_err(zd_mac_dev(mac),
"Giving up beacon config.\n");
r = -ETIMEDOUT;
- goto release_sema;
+ goto reset_device;
}
}
msleep(20);
@@ -770,6 +770,17 @@ out:
mutex_unlock(&mac->chip.mutex);
kfree(ioreqs);
return r;
+
+reset_device:
+ mutex_unlock(&mac->chip.mutex);
+ kfree(ioreqs);
+
+ /* semaphore stuck, reset device to avoid fw freeze later */
+ dev_warn(zd_mac_dev(mac), "CR_BCN_FIFO_SEMAPHORE stuck, "
+ "reseting device...");
+ usb_queue_reset_device(mac->chip.usb.intf);
+
+ return r;
}
static int fill_ctrlset(struct zd_mac *mac,