Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wlcore: block read/writes to FW during ELP

When the chip is in ELP mode read/write to FW is invalid and may cause
the lower layers to get stuck. The reads/writes concerning ELP wakeup
are the exception here and are checked for. In addition to blocking the
IO, produce a warning.

Signed-off-by: Barak Bercovitz <barak@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Barak Bercovitz and committed by
John W. Linville
51ae14d0 9be86cf0

+6 -2
+6 -2
drivers/net/wireless/ti/wlcore/io.h
··· 60 60 { 61 61 int ret; 62 62 63 - if (test_bit(WL1271_FLAG_IO_FAILED, &wl->flags)) 63 + if (test_bit(WL1271_FLAG_IO_FAILED, &wl->flags) || 64 + WARN_ON((test_bit(WL1271_FLAG_IN_ELP, &wl->flags) && 65 + addr != HW_ACCESS_ELP_CTRL_REG))) 64 66 return -EIO; 65 67 66 68 ret = wl->if_ops->write(wl->dev, addr, buf, len, fixed); ··· 78 76 { 79 77 int ret; 80 78 81 - if (test_bit(WL1271_FLAG_IO_FAILED, &wl->flags)) 79 + if (test_bit(WL1271_FLAG_IO_FAILED, &wl->flags) || 80 + WARN_ON((test_bit(WL1271_FLAG_IN_ELP, &wl->flags) && 81 + addr != HW_ACCESS_ELP_CTRL_REG))) 82 82 return -EIO; 83 83 84 84 ret = wl->if_ops->read(wl->dev, addr, buf, len, fixed);