rtw89: support FW crash simulation
authorZong-Zhe Yang <kevin_yang@realtek.com>
Mon, 14 Mar 2022 07:12:50 +0000 (15:12 +0800)
committerKalle Valo <kvalo@kernel.org>
Wed, 6 Apr 2022 07:46:03 +0000 (10:46 +0300)
commitedb896297abeef8c95c150247607b09517469a9a
treee56827a3e5735d8cc46e7b1b55a46d29f8649e4a
parent11fe4ccda8672db5375f8bfcb209756a31c89a82
rtw89: support FW crash simulation

Originally, there is already a mechanism, SER (system error recover),
to deal with HW/FW recovery. After FW v0.13.36.0, FW supports a H2C
(host to chip) command to make a CPU exception. Then, SER is supposed
to catch this FW crash and do L2 reset. This feature is a simulation
to verify if flow of recovering from FW crash works.

Usage of fw_crash debugfs is as the following.
$ echo 1 > fw_crash // trigger FW crash and wait SER handling
$ cat fw_crash // return 0 if restart has been done

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@kernel.org>
Link: https://lore.kernel.org/r/20220314071250.40292-9-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/core.h
drivers/net/wireless/realtek/rtw89/debug.c
drivers/net/wireless/realtek/rtw89/fw.c
drivers/net/wireless/realtek/rtw89/fw.h
drivers/net/wireless/realtek/rtw89/ser.c