diff options
author | Maya Erez <qca_merez@qca.qualcomm.com> | 2017-12-14 18:53:09 +0200 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2018-01-09 10:03:27 +0200 |
commit | a8fd16d7a14fad9a7ecaa0932eefd243f62394b9 (patch) | |
tree | 2d090d3d7e030218d97f4b7573ceef798eeb2c59 /drivers/net/wireless/ath/wil6210/wil_crash_dump.c | |
parent | wil6210: set platform features based on FW capabilities (diff) | |
download | linux-dev-a8fd16d7a14fad9a7ecaa0932eefd243f62394b9.tar.xz linux-dev-a8fd16d7a14fad9a7ecaa0932eefd243f62394b9.zip |
wil6210: prevent parallel suspend and dump collection
Suspend and crash dump operations can happen simultaneously
in case there is a FW assert during the suspend procedure
or when SSR calls all the devices crashdump callbacks.
To prevent that, a new flag is added, indicating that the
dumps collection is in progress, in order to allow the
suspend/reset decline if the dumps collection already started.
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210/wil_crash_dump.c')
-rw-r--r-- | drivers/net/wireless/ath/wil6210/wil_crash_dump.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/wil6210/wil_crash_dump.c b/drivers/net/wireless/ath/wil6210/wil_crash_dump.c index e53cf0cf7031..1ed330674d9b 100644 --- a/drivers/net/wireless/ath/wil6210/wil_crash_dump.c +++ b/drivers/net/wireless/ath/wil6210/wil_crash_dump.c @@ -72,6 +72,15 @@ int wil_fw_copy_crash_dump(struct wil6210_priv *wil, void *dest, u32 size) return -EINVAL; } + set_bit(wil_status_collecting_dumps, wil->status); + if (test_bit(wil_status_suspending, wil->status) || + test_bit(wil_status_suspended, wil->status) || + test_bit(wil_status_resetting, wil->status)) { + wil_err(wil, "cannot collect fw dump during suspend/reset\n"); + clear_bit(wil_status_collecting_dumps, wil->status); + return -EINVAL; + } + /* copy to crash dump area */ for (i = 0; i < ARRAY_SIZE(fw_mapping); i++) { map = &fw_mapping[i]; @@ -91,6 +100,8 @@ int wil_fw_copy_crash_dump(struct wil6210_priv *wil, void *dest, u32 size) (const void __iomem * __force)data, len); } + clear_bit(wil_status_collecting_dumps, wil->status); + return 0; } |