1aafb329680db298cda9856c978ff7f8d4ead162
[openwrt/staging/lynxis/omap.git] / package / kernel / mac80211 / patches / 903-wlcore-block-read-writes-to-FW-during-ELP.patch
1 When the chip is in ELP mode read/write to FW is invalid and may cause
2 the lower layers to get stuck. The reads/writes concerning ELP wakeup
3 are the exception here and are checked for. In addition to blocking the
4 IO, produce a warning.
5
6 Signed-off-by: Barak Bercovitz <barak@wizery.com>
7 Signed-off-by: Eliad Peller <eliad@wizery.com>
8
9 ---
10 drivers/net/wireless/ti/wlcore/io.h | 8 ++++++--
11 1 file changed, 6 insertions(+), 2 deletions(-)
12
13 --- a/drivers/net/wireless/ti/wlcore/io.h
14 +++ b/drivers/net/wireless/ti/wlcore/io.h
15 @@ -60,7 +60,9 @@ static inline int __must_check wlcore_ra
16 {
17 int ret;
18
19 - if (test_bit(WL1271_FLAG_IO_FAILED, &wl->flags))
20 + if (test_bit(WL1271_FLAG_IO_FAILED, &wl->flags) ||
21 + WARN_ON((test_bit(WL1271_FLAG_IN_ELP, &wl->flags) &&
22 + addr != HW_ACCESS_ELP_CTRL_REG)))
23 return -EIO;
24
25 ret = wl->if_ops->write(wl->dev, addr, buf, len, fixed);
26 @@ -76,7 +78,9 @@ static inline int __must_check wlcore_ra
27 {
28 int ret;
29
30 - if (test_bit(WL1271_FLAG_IO_FAILED, &wl->flags))
31 + if (test_bit(WL1271_FLAG_IO_FAILED, &wl->flags) ||
32 + WARN_ON((test_bit(WL1271_FLAG_IN_ELP, &wl->flags) &&
33 + addr != HW_ACCESS_ELP_CTRL_REG)))
34 return -EIO;
35
36 ret = wl->if_ops->read(wl->dev, addr, buf, len, fixed);