From: Zhao Li <enderaoelyther@gmail.com>
To: Jeff Chen <jeff.chen_1@nxp.com>
Cc: Jeff Chen <jeff.chen_1@oss.nxp.com>,
Francesco Dolcini <francesco@dolcini.it>,
Johannes Berg <johannes@sipsolutions.net>,
Arend van Spriel <arend.vanspriel@broadcom.com>,
Jiangshan Yi <yijiangshan@kylinos.cn>,
Linmao Li <lilinmao@kylinos.cn>,
Kees Cook <kees+treewide@kernel.org>,
Rosen Penev <rosenp@gmail.com>,
Benjamin Berg <benjamin.berg@intel.com>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, Zhao Li <enderaoelyther@gmail.com>
Subject: [PATCH wireless v2 1/4] wifi: nxpwifi: cancel channel switch work on teardown
Date: Thu, 19 Nov 2026 02:35:03 +0800 [thread overview]
Message-ID: <20261118183506.45749-2-enderaoelyther@gmail.com> (raw)
In-Reply-To: <20261118183506.45749-1-enderaoelyther@gmail.com>
Stopping an AP while channel-switch work is pending leaves the delayed
work armed, and the callback later runs on an AP that is gone, or on
freed driver state after removal.
Cancel the work when the AP stops, and clear uap_stop_tx, which a
pending switch with block_tx has set. Interface deletion, type changes
and driver removal all stop a running AP first.
Found by code review. Compile-tested with W=1.
Fixes: 73b01e57ed3e ("wifi: nxp: add nxpwifi driver for IW61x")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
---
No new W=1, sparse or smatch warnings.
AI assistance was used.
drivers/net/wireless/nxp/nxpwifi/cfg80211.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/nxp/nxpwifi/cfg80211.c b/drivers/net/wireless/nxp/nxpwifi/cfg80211.c
index ba54078b082c..5b8fb37c3f3d 100644
--- a/drivers/net/wireless/nxp/nxpwifi/cfg80211.c
+++ b/drivers/net/wireless/nxp/nxpwifi/cfg80211.c
@@ -1639,6 +1639,8 @@ static int nxpwifi_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *dev,
struct nxpwifi_private *priv = nxpwifi_netdev_get_priv(dev);
int ret;
+ wiphy_delayed_work_cancel(wiphy, &priv->dfs_chan_sw_work);
+ priv->uap_stop_tx = false;
nxpwifi_abort_cac(priv);
if (nxpwifi_del_mgmt_ies(priv))
--
2.56.1
next prev parent reply other threads:[~2026-11-18 18:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 18:35 [PATCH wireless v2 0/4] wifi: nxpwifi: fix AP channel-switch lifetime and failures Zhao Li
2026-11-18 18:35 ` Zhao Li [this message]
2026-11-18 18:35 ` [PATCH wireless v2 2/4] wifi: nxpwifi: stop AP TX after preparing channel switch Zhao Li
2026-11-18 18:35 ` [PATCH wireless v2 3/4] wifi: nxpwifi: own beacon data used by channel switch work Zhao Li
2026-11-18 18:35 ` [PATCH wireless v2 4/4] wifi: nxpwifi: stop AP when delayed channel switch fails Zhao Li
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=20261118183506.45749-2-enderaoelyther@gmail.com \
--to=enderaoelyther@gmail.com \
--cc=arend.vanspriel@broadcom.com \
--cc=benjamin.berg@intel.com \
--cc=francesco@dolcini.it \
--cc=jeff.chen_1@nxp.com \
--cc=jeff.chen_1@oss.nxp.com \
--cc=johannes@sipsolutions.net \
--cc=kees+treewide@kernel.org \
--cc=lilinmao@kylinos.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=rosenp@gmail.com \
--cc=stable@vger.kernel.org \
--cc=yijiangshan@kylinos.cn \
/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
all inboxes | Powered by JetHome®