diff options
author | Arik Nemtsov <arik@wizery.com> | 2012-07-03 06:00:18 (GMT) |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-07-10 16:10:14 (GMT) |
commit | 4455556d71951cfb6010e267efd00a52b63c2c20 (patch) | |
tree | 43215b3cbd2fa5a47316c8ca137a7546b49dd6c4 /drivers/net/wireless/ti/wlcore/io.h | |
parent | c45ee4ff1f66b2a02f51b8a2c1c3dcfd7faefab0 (diff) | |
download | linux-4455556d71951cfb6010e267efd00a52b63c2c20.tar.xz |
wlcore: don't set SDIO_FAILED flag when driver state is off
If some IO read/write fails while the FW is not loaded, a recovery
will not take place. This means the SDIO_FAILED flag will stay in place
forever and prevent further read/writes.
This can happen if a check for STATE_OFF was forgotten in some routine.
Take this opportunity to rename the flag to IO_FAILED, since we support
other buses as well.
Reported-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Diffstat (limited to 'drivers/net/wireless/ti/wlcore/io.h')
-rw-r--r-- | drivers/net/wireless/ti/wlcore/io.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/wireless/ti/wlcore/io.h b/drivers/net/wireless/ti/wlcore/io.h index 458da55..259149f 100644 --- a/drivers/net/wireless/ti/wlcore/io.h +++ b/drivers/net/wireless/ti/wlcore/io.h @@ -60,12 +60,12 @@ static inline int __must_check wlcore_raw_write(struct wl1271 *wl, int addr, { int ret; - if (test_bit(WL1271_FLAG_SDIO_FAILED, &wl->flags)) + if (test_bit(WL1271_FLAG_IO_FAILED, &wl->flags)) return -EIO; ret = wl->if_ops->write(wl->dev, addr, buf, len, fixed); - if (ret) - set_bit(WL1271_FLAG_SDIO_FAILED, &wl->flags); + if (ret && wl->state != WL1271_STATE_OFF) + set_bit(WL1271_FLAG_IO_FAILED, &wl->flags); return ret; } @@ -76,12 +76,12 @@ static inline int __must_check wlcore_raw_read(struct wl1271 *wl, int addr, { int ret; - if (test_bit(WL1271_FLAG_SDIO_FAILED, &wl->flags)) + if (test_bit(WL1271_FLAG_IO_FAILED, &wl->flags)) return -EIO; ret = wl->if_ops->read(wl->dev, addr, buf, len, fixed); - if (ret) - set_bit(WL1271_FLAG_SDIO_FAILED, &wl->flags); + if (ret && wl->state != WL1271_STATE_OFF) + set_bit(WL1271_FLAG_IO_FAILED, &wl->flags); return ret; } |