wifi: ath9k: refuse spectral scan control while the hardware is disabled
PATCH 1/1 wifi: ath9k: refuse spectral scan control while the hardware is disabled
The spectral_scan_ctl debugfs file drives PHY register writes, and nothing checks whether the hardware is up. While the interface is down the chip is asleep, and on the AR9271 those writes go over WMI to a sleeping target and hang the firmware until the device is re-enumerated.
Refuse the write with -EBUSY while ATH_OP_INVALID is set. The reset control already refuses on the same flag.
--- drivers/net/wireless/ath/ath9k/common-spectral.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/net/wireless/ath/ath9k/common-spectral.c +8 -0
@@ -805,6 +805,14 @@ static ssize_t write_file_spec_scan_ctl(struct file *file, buf[len] ='\0' ; +/* Every command below drives PHY register writes. Refuse them while +* the hardware is disabled (the interface is down): on the AR9271 +* that traffic hangs the firmware until the device is re-enumerated. +* The reset control refuses on the same flag. +*/ +if (test_bit (ATH_OP_INVALID , &common->op_flags)) +return -EBUSY ; +if (strncmp ("trigger" , buf,7 ) ==0 ) {ath9k_cmn_spectral_scan_trigger (common, spec_priv); }else if (strncmp ("background" , buf,10 ) ==0 ) {
base-commit: 1d8e73163ef933624341075f576e2f36ef9133f7
Signature · 1 line
2.55.0
Quoted 10 lines · Nerijus Bendžiūnas
The
spectral_scan_ctldebugfs file drives PHY register writes, and nothing checks whether the hardware is up. While the interface is down the chip is asleep, and on the AR9271 those writes go over WMI to a sleeping target and hang the firmware until the device is re-enumerated.Refuse the write with
-EBUSYwhileATH_OP_INVALIDis set. The reset control already refuses on the same flag.Assisted-by LLMSigned-off-by Nerijus Bendžiūnas <[email protected]>
Jeff Johnson
AppliedQuoted 9 lines · Nerijus Bendžiūnas
The
spectral_scan_ctldebugfs file drives PHY register writes, and nothing checks whether the hardware is up. While the interface is down the chip is asleep, and on the AR9271 those writes go over WMI to a sleeping target and hang the firmware until the device is re-enumerated.Refuse the write with
-EBUSYwhileATH_OP_INVALIDis set. The reset control already refuses on the same flag.[...]
Applied, thanks!
[1/1] wifi: ath9k: refuse spectral scan control while the hardware is disabled
commit: 59411703660919197234fa0ec80ee1a5bcbe4276
Best regards,
Signature · 1 line
Jeff Johnson <[email protected]>