Bug 217183

Summary: AR9462/ath9k: running wifi scan freezes the laptop
Product: Drivers Reporter: primalmotion (primalmotion)
Component: network-wirelessAssignee: drivers_network-wireless (drivers_network-wireless)
Status: NEW ---    
Severity: normal CC: kvalo, malocascio, toke
Priority: P1    
Hardware: Intel   
OS: Linux   
Kernel Version: >= 6.2.1 Subsystem:
Regression: No Bisected commit-id:
Attachments: journalctl -k output on kernel 6.2.6

Description primalmotion 2023-03-12 19:27:05 UTC
Since 6.2.1 (and onward), running a wifi scan freezes the laptop completely. The screen is frozen, caps lock led is on, and there's nothing left to do but force reboot.

Step to reproduce:
1) iwctl station wlan0 scan

This works just fine on 6.1.12 and below. 
This is 100% reproducible. 

I can't find any relevant log. I tried to collect dmesg and journalctl -k while I was performing the command, but the laptop freezes before I can get anything.

Card: Qualcomm Atheros AR9462 Wireless Network Adapter (rev 01)
Driver: ath9k

module parameters:
/sys/module/ath9k/parameters/blink 0
/sys/module/ath9k/parameters/bt_ant_diversity 0
/sys/module/ath9k/parameters/btcoex_enable 1
/sys/module/ath9k/parameters/led_active_high -1
/sys/module/ath9k/parameters/ps_enable 1
/sys/module/ath9k/parameters/use_chanctx 0
/sys/module/ath9k/parameters/use_msi 0

Let me know if you need any additional logs from other places I don't know
Comment 1 Kalle Valo 2023-03-13 10:44:51 UTC
Can you do a git bisect to find the commit which broke this? Also setting up a netconsole to catch the logs before the crash is nice, but you need ethernet for that.
Comment 2 primalmotion 2023-03-13 17:08:10 UTC
I did more tests playing with the driver parameters. What seems to cause the freeze is enabling the option btcoex_enable=1. Without this option set, scanning works as expected.
Comment 3 Toke Høiland-Jørgensen 2023-03-13 21:05:44 UTC
Does 6.1 work regardless of the value of the btcoex_enable parameter? In fact, nothing has really changed *at all* in the driver between those two versions apart from compile fixes. So that suggest this is a mac80211-induced regression; perhaps the same underlying issue as https://bugzilla.kernel.org/show_bug.cgi?id=217119 ?
Comment 4 primalmotion 2023-03-13 21:14:01 UTC
Yes, it does work with btcoex_enable on 6.1
Comment 5 Toke Høiland-Jørgensen 2023-03-15 13:52:57 UTC
Hmm, okay, don't really see any obvious connection here, then. Not sure we can get any closer without a bisect and/or a kernel log when the crash happens :(
Comment 6 malocascio 2023-03-19 04:45:11 UTC
I've been having the same issue on Arch Linux. The 6.1.9 kernel works fine, but kernels 6.2 and above are unstable. The system isn't always totally unusable, though, so I was able to get the output of `journalctl -k`. I have attached it here.

The system is an Acer C720 with an Atheros AR9462 wireless interface.
Comment 7 malocascio 2023-03-19 04:46:31 UTC
Created attachment 303981 [details]
journalctl -k output on kernel 6.2.6
Comment 8 Toke Høiland-Jørgensen 2023-04-13 21:45:25 UTC
Ah! That stack trace did indeed narrow it down, and I'm pretty sure I see the change that caused this. Sent a fix, here: https://lore.kernel.org/r/20230413214118.153781-1-toke@toke.dk
Comment 9 primalmotion 2023-04-14 03:41:12 UTC
I confirm this patch fixes my issue! Thanks!
Comment 10 Toke Høiland-Jørgensen 2023-04-14 09:30:46 UTC
Great, thank you for testing!