[RFC] [PATCH] wifi: ath12k: wait for chan update in reg_notifier
Ionic
ionic at ionic.de
Mon Dec 9 14:00:39 PST 2024
* On 12/9/24 22:47, Mihai Moldovan wrote:
> Currently, setting a new regdomain is asynchronous in ath12k, in the
> [...]
Making the reg_notifier synchronous with the actual reg update fixes the issue.
In short, when setting a new reg domain, the reg notifier is called as the last
step by cfg80211 before sending a regdom change event over netlink, but since
the reg_notifier is not waiting for the hardware to apply the new country code
to the firmware and update things like the channel list, things can fail in user
space.
I implemented a regd_update completion in ah and added a wait call in
reg_notifier, as well as completing it in regd_update, with (re-)initializers in
mac_hw_register and mac_hw_unregister.
I'm not quite sure if ah is the correct place for that, but it felt like the
most appropriate. ar is too low-level (since multiple ar can share an ah IIRC)
and it should generally not be possible to set per-ar regdomains, although
per-phy regdomains are possible, but every phy should have an ah (I guess?). Not
sure how vdevs play into this.
Can you please test and review this? If it's already good, feel free to include
it in your series.
ath11k is suffering from the same issue - I just haven't noticed it before
because the default regdomain of the ath11k-based card I use is set to US, which
allows operations on channel 96 to 144. If I set CN first, I can easily
reproduce the same issue with ath11k, so I'll have to backport a good patch to
ath11k as well.
Mihai
More information about the ath12k
mailing list