brcmfmac: fix firmware trap while dumping obss stats
authorWright Feng <wright.feng@cypress.com>
Thu, 29 Sep 2022 01:25:25 +0000 (20:25 -0500)
committerKalle Valo <kvalo@kernel.org>
Tue, 4 Oct 2022 08:27:32 +0000 (11:27 +0300)
commit216647e6aaaf14773d85b6681eca1344bcd14757
tree6aa99c7d8158f8fc932245cd29cef75a43d19869
parent6c04deae1438e5df59fc4848795248fc34961f51
brcmfmac: fix firmware trap while dumping obss stats

When doing dump_survey, host will call "dump_obss" iovar to firmware
side. Host need to make sure the HW clock in dongle is on, or there is
high probability that firmware gets trap because register or shared
memory access failed. To fix this, we disable mpc when doing dump obss
and set it back after that.

[28350.512799] brcmfmac: brcmf_dump_obss: dump_obss error (-52)
[28743.402314] ieee80211 phy0: brcmf_fw_crashed: Firmware has halted or
crashed
[28745.869430] brcmfmac: brcmf_sdio_bus_rxctl: resumed on timeout
[28745.877546] brcmfmac: brcmf_sdio_checkdied: firmware trap in dongle

Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Chi-hsien Lin <chi-hsien.lin@infineon.com>
Signed-off-by: Ian Lin <ian.lin@infineon.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220929012527.4152-3-ian.lin@infineon.com
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c