rtw88: refine fw_crash debugfs to show non-zero while triggering
authorZong-Zhe Yang <kevin_yang@realtek.com>
Fri, 1 Oct 2021 08:23:01 +0000 (16:23 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 5 Oct 2021 05:28:36 +0000 (08:28 +0300)
commit6cd4b59ddb1ab8db989168a1e38308ab73dce4dc
treeb8ae75dcbddd50028b0d15d6e317a7179ce82326
parentc5a8e90730a322f236731fc347dd3afa5db5550e
rtw88: refine fw_crash debugfs to show non-zero while triggering

The usage of fw_crash debugfs is to write 1 to it to trigger fw crash
simulation and to read from it to check the state. When zero is read,
it is supposed to mean fw crash/restart process is done. Then, some
test plans can be designed for crash/restart.
e.g.
step 1. trigger fw crash simulation
step 2. poll the state until zero is read
step 3. check connection by ping test

However, in certain connection cases, triggering fw crash simulation
will take a while. If the state is queried too early before restart
begins processing, it may mistakenly think restart process has been
done. If some tests are started at this time, something unexpected
might happen due to the follow-up restart process.

To avoid that, let fw_crash also show non-zero when a simulation
is still triggering.

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211001082301.4805-1-pkshih@realtek.com
drivers/net/wireless/realtek/rtw88/debug.c
drivers/net/wireless/realtek/rtw88/main.c
drivers/net/wireless/realtek/rtw88/main.h