public inbox for ath12k@lists.infradead.org
 help / color / mirror / Atom feed
From: Ionic <ionic@ionic.de>
To: ath12k@lists.infradead.org, Kang Yang <quic_kangyang@quicinc.com>
Subject: Re: [RFC] [PATCH] wifi: ath12k: wait for chan update in reg_notifier
Date: Mon, 9 Dec 2024 23:00:39 +0100	[thread overview]
Message-ID: <71b9b05a-55b0-4727-a1a1-eb57afe55637@ionic.de> (raw)
In-Reply-To: <8b2a2c54f34c60f2170bd0cfc01c602dbb8e5d96.1733780780.git.ionic@ionic.de>

* 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


  reply	other threads:[~2024-12-09 22:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-17  3:09 [PATCH v6 0/4] wifi: ath12k: store and send country code to firmware after recovery Kang Yang
2024-10-17  3:09 ` [PATCH v6 1/4] wifi: ath12k: add configure country code for WCN7850 Kang Yang
2024-10-17  3:09 ` [PATCH v6 2/4] wifi: ath12k: add 11d scan offload support Kang Yang
2024-10-17  3:09 ` [PATCH v6 3/4] wifi: ath12k: use correct WMI command to set country code for WCN7850 Kang Yang
2024-10-17  3:09 ` [PATCH v6 4/4] wifi: ath12k: store and send country code to firmware after recovery Kang Yang
2024-10-17 18:55 ` [PATCH v6 0/4] " Jeff Johnson
2024-11-20 16:50   ` Mihai Moldovan
2024-11-21 11:03     ` Kalle Valo
2024-11-22 20:17       ` Mihai Moldovan
2024-11-29 12:18 ` Mihai Moldovan
2024-12-02  1:53   ` Kang Yang
2024-12-02  8:47     ` Mihai Moldovan
2024-12-09 21:47       ` [RFC] [PATCH] wifi: ath12k: wait for chan update in reg_notifier Mihai Moldovan
2024-12-09 22:00         ` Ionic [this message]
2024-12-11  2:18           ` Kang Yang
2024-12-11 16:14             ` Mihai Moldovan
2024-12-10 23:19         ` [RFC] [PATCH v2] " Mihai Moldovan
2024-12-11  4:32       ` [PATCH v6 0/4] wifi: ath12k: store and send country code to firmware after recovery Kang Yang
2024-12-11 16:22         ` Mihai Moldovan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=71b9b05a-55b0-4727-a1a1-eb57afe55637@ionic.de \
    --to=ionic@ionic.de \
    --cc=ath12k@lists.infradead.org \
    --cc=quic_kangyang@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox