From: Brian Norris <briannorris@chromium.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org,
Johannes Berg <johannes.berg@intel.com>,
Francesco Dolcini <francesco@dolcini.it>
Subject: Re: [PATCH wireless-next v2 09/18] wifi: cfg80211: document wiphy mutex for radar/CAC events
Date: Mon, 5 Oct 2026 10:46:48 -0700 [thread overview]
Message-ID: <asPiiI6-JpMd3vKr@google.com> (raw)
In-Reply-To: <20261005120526.fe5960ae72ab.I57002ac3e57d2ac4613eb0cb0e6d17bedccf0cbd@changeid>
On Mon, Oct 05, 2026 at 12:03:36PM +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> 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. Is this something you'd
prefer individual driver users/maintainers resolve?
> - qtnfmac also does it from event processing, and
> - mt7915 and mt7996 don't acquire a mutex for background
> radar events.
>
> Document the requirement.
>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
> include/net/cfg80211.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> index 9cb536fc8cb8..eb376a54a07f 100644
> --- a/include/net/cfg80211.h
> +++ b/include/net/cfg80211.h
> @@ -9794,6 +9794,7 @@ void cfg80211_cqm_beacon_loss_notify(struct net_device *dev, gfp_t gfp);
> * @gfp: context flags
> *
> * This function is called when a radar is detected on the current chanenl.
> + * Must be called with the wiphy mutex held.
> */
> void __cfg80211_radar_event(struct wiphy *wiphy,
> struct cfg80211_chan_def *chandef,
> @@ -9839,7 +9840,7 @@ void cfg80211_sta_opmode_change_notify(struct net_device *dev, const u8 *mac,
> *
> * This function is called when a Channel availability check (CAC) is finished
> * or aborted. This must be called to notify the completion of a CAC process,
> - * also by full-MAC drivers.
> + * also by full-MAC drivers. Must be called with the wiphy mutex held.
> */
> 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);
> --
> 2.55.0
>
>
next prev parent reply other threads:[~2026-10-05 17:46 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 [this message]
2026-10-05 17:52 ` Johannes Berg
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=asPiiI6-JpMd3vKr@google.com \
--to=briannorris@chromium.org \
--cc=francesco@dolcini.it \
--cc=johannes.berg@intel.com \
--cc=johannes@sipsolutions.net \
--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