aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti/wlcore
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2012-06-21 11:10:48 -0400
committerLuciano Coelho <coelho@ti.com>2012-06-23 02:28:54 -0400
commit1d23396d9df0a9543b2ba5c288f4914ad1f19e46 (patch)
treecf797bb7a56a8f79e65e4503d4f739b4c8e748c1 /drivers/net/wireless/ti/wlcore
parent96caded8d275f67c6000fa219b0c11e7d6bf8e0b (diff)
wlcore: don't allow SDIO read/writes after failure
Set a flag and after the first read/write failure is encountered. This flag will disallow further SDIO read/writes until op_stop() is executed, which will clear all flags. This prevents further errors from occurring, since one error usually indicates that IO operations won't work anymore until the chip is rebooted. By blocking more calls, we avoid extra timeouts and having to wait for them to occur. [Added second paragraph explaining why the change is needed. -- Luca] Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/ti/wlcore')
-rw-r--r--drivers/net/wireless/ti/wlcore/io.h22
-rw-r--r--drivers/net/wireless/ti/wlcore/wlcore_i.h1
2 files changed, 21 insertions, 2 deletions
diff --git a/drivers/net/wireless/ti/wlcore/io.h b/drivers/net/wireless/ti/wlcore/io.h
index 1cd545b0ed1e..fef80adc8bf5 100644
--- a/drivers/net/wireless/ti/wlcore/io.h
+++ b/drivers/net/wireless/ti/wlcore/io.h
@@ -57,14 +57,32 @@ static inline int __must_check wlcore_raw_write(struct wl1271 *wl, int addr,
57 void *buf, size_t len, 57 void *buf, size_t len,
58 bool fixed) 58 bool fixed)
59{ 59{
60 return wl->if_ops->write(wl->dev, addr, buf, len, fixed); 60 int ret;
61
62 if (test_bit(WL1271_FLAG_SDIO_FAILED, &wl->flags))
63 return -EIO;
64
65 ret = wl->if_ops->write(wl->dev, addr, buf, len, fixed);
66 if (ret)
67 set_bit(WL1271_FLAG_SDIO_FAILED, &wl->flags);
68
69 return ret;
61} 70}
62 71
63static inline int __must_check wlcore_raw_read(struct wl1271 *wl, int addr, 72static inline int __must_check wlcore_raw_read(struct wl1271 *wl, int addr,
64 void *buf, size_t len, 73 void *buf, size_t len,
65 bool fixed) 74 bool fixed)
66{ 75{
67 return wl->if_ops->read(wl->dev, addr, buf, len, fixed); 76 int ret;
77
78 if (test_bit(WL1271_FLAG_SDIO_FAILED, &wl->flags))
79 return -EIO;
80
81 ret = wl->if_ops->read(wl->dev, addr, buf, len, fixed);
82 if (ret)
83 set_bit(WL1271_FLAG_SDIO_FAILED, &wl->flags);
84
85 return ret;
68} 86}
69 87
70static inline int __must_check wlcore_raw_read_data(struct wl1271 *wl, int reg, 88static inline int __must_check wlcore_raw_read_data(struct wl1271 *wl, int reg,
diff --git a/drivers/net/wireless/ti/wlcore/wlcore_i.h b/drivers/net/wireless/ti/wlcore/wlcore_i.h
index e5a34dd34baf..4273a21cdde1 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore_i.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore_i.h
@@ -247,6 +247,7 @@ enum wl12xx_flags {
247 WL1271_FLAG_RECOVERY_IN_PROGRESS, 247 WL1271_FLAG_RECOVERY_IN_PROGRESS,
248 WL1271_FLAG_VIF_CHANGE_IN_PROGRESS, 248 WL1271_FLAG_VIF_CHANGE_IN_PROGRESS,
249 WL1271_FLAG_INTENDED_FW_RECOVERY, 249 WL1271_FLAG_INTENDED_FW_RECOVERY,
250 WL1271_FLAG_SDIO_FAILED,
250}; 251};
251 252
252enum wl12xx_vif_flags { 253enum wl12xx_vif_flags {