Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 51ae14d0 authored by Barak Bercovitz's avatar Barak Bercovitz Committed by John W. Linville
Browse files

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: default avatarBarak Bercovitz <barak@wizery.com>
Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 9be86cf0
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -60,7 +60,9 @@ static inline int __must_check wlcore_raw_write(struct wl1271 *wl, int addr,
{
	int ret;

	if (test_bit(WL1271_FLAG_IO_FAILED, &wl->flags))
	if (test_bit(WL1271_FLAG_IO_FAILED, &wl->flags) ||
	    WARN_ON((test_bit(WL1271_FLAG_IN_ELP, &wl->flags) &&
		     addr != HW_ACCESS_ELP_CTRL_REG)))
		return -EIO;

	ret = wl->if_ops->write(wl->dev, addr, buf, len, fixed);
@@ -76,7 +78,9 @@ static inline int __must_check wlcore_raw_read(struct wl1271 *wl, int addr,
{
	int ret;

	if (test_bit(WL1271_FLAG_IO_FAILED, &wl->flags))
	if (test_bit(WL1271_FLAG_IO_FAILED, &wl->flags) ||
	    WARN_ON((test_bit(WL1271_FLAG_IN_ELP, &wl->flags) &&
		     addr != HW_ACCESS_ELP_CTRL_REG)))
		return -EIO;

	ret = wl->if_ops->read(wl->dev, addr, buf, len, fixed);