From: Johannes Berg <johannes@sipsolutions.net>
To: Brian Norris <briannorris@chromium.org>
Cc: linux-wireless@vger.kernel.org, Francesco Dolcini <francesco@dolcini.it>
Subject: Re: [PATCH wireless-next v2 09/18] wifi: cfg80211: document wiphy mutex for radar/CAC events
Date: Mon, 05 Oct 2026 19:52:11 +0200 [thread overview]
Message-ID: <c5990e315e83eb6014d6ab02f9846a9d10a901f8.camel@sipsolutions.net> (raw)
In-Reply-To: <asPiiI6-JpMd3vKr@google.com> (sfid-20261005_194653_412780_31ACF618)
Hi Brian,
Woah, thanks for looking through this! :-)
On Mon, 2026-10-05 at 10:46 -0700, Brian Norris wrote:
> > The DFS state of channels and the CAC state of the wdev is
> > protected by the wiphy mutex, so the radar and CAC events
> > must be reported by drivers with the wiphy mutex held. In
> > mac80211 we do this, but some drivers don't yet:
> > - mwifiex/nxpwifi have an event handling worker,
>
> FWIW, one of the two contexts that call cfg80211_cac_event() in mwifiex
> does *not* (by inspection) seem to hold this.
Yeah I know - that's why I wrote "some drivers __don't__ yet".
It's always been broken though, and I kinda just wanted to move on. It's
racy, but I think mostly wrt. the valid_links warning (which isn't
relevant here) and the data accesses, nothing worse will happen.
> Is this something you'd
> prefer individual driver users/maintainers resolve?
I think so. Or we can discuss it should be async in cfg80211, or an
async version? I guess first we should discuss how to solve it either
way, and look at all the drivers that still have the issue.
> > void cfg80211_cac_event(struct net_device *netdev,
> > const struct cfg80211_chan_def *chandef,
>
> Should we add an assert to this API?
>
> lockdep_assert_wiphy(wiphy);
Well I figured if I do that now then tools (and perhaps people) will
start complaining and that'd just put more pressure on everyone to fix
it ... that's why I didn't yet, but I guess I should've outlined that
better in the commit message (even after a --- marker).
johannes
next prev parent reply other threads:[~2026-10-05 17:52 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-05 10:03 [PATCH wireless-next v2 01/18] wifi: further RTNL redux Johannes Berg
2026-10-05 10:03 ` [PATCH wireless-next v2 01/18] wifi: cfg80211: track netdev running state under wiphy mutex Johannes Berg
2026-10-05 10:03 ` [PATCH wireless-next v2 02/18] wifi: nl80211: allow device lookup under RCU Johannes Berg
2026-10-05 10:03 ` [PATCH wireless-next v2 03/18] wifi: nl80211: avoid rtnl for commands that don't want it Johannes Berg
2026-10-05 10:03 ` [PATCH wireless-next v2 04/18] wifi: nl80211: don't take rtnl for most dumps Johannes Berg
2026-10-05 10:03 ` [PATCH wireless-next v2 05/18] wifi: cfg80211: reg: update channels under wiphy mutex Johannes Berg
2026-10-05 10:03 ` [PATCH wireless-next v2 06/18] wifi: cfg80211: reg: set intersected regd " Johannes Berg
2026-10-05 10:03 ` [PATCH wireless-next v2 07/18] wifi: cfg80211: update channel DFS data " Johannes Berg
2026-10-05 10:03 ` [PATCH wireless-next v2 08/18] wifi: mac80211_hwsim: call cfg80211 event with " Johannes Berg
2026-10-05 10:03 ` [PATCH wireless-next v2 09/18] wifi: cfg80211: document wiphy mutex for radar/CAC events Johannes Berg
2026-10-05 17:46 ` Brian Norris
2026-10-05 17:52 ` Johannes Berg [this message]
2026-10-05 18:36 ` Brian Norris
2026-10-05 18:43 ` Johannes Berg
2026-10-05 10:03 ` [PATCH wireless-next v2 10/18] wifi: cfg80211: add a mutex for regulatory/device list Johannes Berg
2026-10-05 10:03 ` [PATCH wireless-next v2 11/18] wifi: cfg80211: allow walking wiphy list under cfg80211_mutex Johannes Berg
2026-10-05 10:03 ` [PATCH wireless-next v2 12/18] wifi: ath: use freq_reg_info() under RCU Johannes Berg
2026-10-05 10:03 ` [PATCH wireless-next v2 13/18] wifi: brcmsmac: " Johannes Berg
2026-10-05 10:03 ` [PATCH wireless-next v2 14/18] wifi: rtlwifi: " Johannes Berg
2026-10-05 10:03 ` [PATCH wireless-next v2 15/18] wifi: nl80211: read WMM reg rule " Johannes Berg
2026-10-05 10:03 ` [PATCH wireless-next v2 16/18] wifi: ath11k: read wiphy regd " Johannes Berg
2026-10-05 10:03 ` [PATCH wireless-next v2 17/18] wifi: ath12k: " Johannes Berg
2026-10-05 10:03 ` [PATCH wireless-next v2 18/18] wifi: cfg80211: regulatory: stop using RTNL Johannes Berg
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=c5990e315e83eb6014d6ab02f9846a9d10a901f8.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=briannorris@chromium.org \
--cc=francesco@dolcini.it \
--cc=linux-wireless@vger.kernel.org \
/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