diff options
author | Ido Yariv <ido@wizery.com> | 2012-08-21 16:17:13 +0200 |
---|---|---|
committer | Luciano Coelho <luca@coelho.fi> | 2012-09-27 11:13:53 +0200 |
commit | d556023895c8968fd97ccb08300006b78975a23b (patch) | |
tree | 589fea6423d4c50ea6af7ddd801da415e94ea77f | |
parent | wlcore: use dynamic keep-alive template ids (diff) | |
download | linux-d556023895c8968fd97ccb08300006b78975a23b.tar.xz linux-d556023895c8968fd97ccb08300006b78975a23b.zip |
wlcore: Allow memory access when the FW crashes
When the no_recovery flag is used, the recovery work will not restart
the FW and the state will not be set to 'on'. To enable post-mortem
analysis, allow memory access in the 'restarting' state.
Also, since the FW might not be operational, don't fail the read/write
operations if elp_wakeup fails.
Reported-by: Arkady Miasnikov <a-miasnikov@ti.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <luca@coelho.fi>
-rw-r--r-- | drivers/net/wireless/ti/wlcore/debugfs.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/net/wireless/ti/wlcore/debugfs.c b/drivers/net/wireless/ti/wlcore/debugfs.c index 3d39784d639b..c86bb00c2488 100644 --- a/drivers/net/wireless/ti/wlcore/debugfs.c +++ b/drivers/net/wireless/ti/wlcore/debugfs.c @@ -1064,14 +1064,16 @@ static ssize_t dev_mem_read(struct file *file, mutex_lock(&wl->mutex); - if (unlikely(wl->state != WLCORE_STATE_ON)) { + if (unlikely(wl->state == WLCORE_STATE_OFF)) { ret = -EFAULT; goto skip_read; } - ret = wl1271_ps_elp_wakeup(wl); - if (ret < 0) - goto skip_read; + /* + * Don't fail if elp_wakeup returns an error, so the device's memory + * could be read even if the FW crashed + */ + wl1271_ps_elp_wakeup(wl); /* store current partition and switch partition */ memcpy(&old_part, &wl->curr_part, sizeof(old_part)); @@ -1149,14 +1151,16 @@ static ssize_t dev_mem_write(struct file *file, const char __user *user_buf, mutex_lock(&wl->mutex); - if (unlikely(wl->state != WLCORE_STATE_ON)) { + if (unlikely(wl->state == WLCORE_STATE_OFF)) { ret = -EFAULT; goto skip_write; } - ret = wl1271_ps_elp_wakeup(wl); - if (ret < 0) - goto skip_write; + /* + * Don't fail if elp_wakeup returns an error, so the device's memory + * could be read even if the FW crashed + */ + wl1271_ps_elp_wakeup(wl); /* store current partition and switch partition */ memcpy(&old_part, &wl->curr_part, sizeof(old_part)); |