From: Vishal Gupta <vishal.gupta_1@philips.com>
To: briannorris@chromium.org
Cc: francesco@dolcini.it, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org,
Vishal Gupta <vishal.gupta_1@philips.com>
Subject: [PATCH 1/1] wifi: mwifiex: synchronize scan cancellation state
Date: Wed, 28 Oct 2026 14:58:18 +0100 [thread overview]
Message-ID: <20261028135818.4166538-1-vishal.gupta_1@philips.com> (raw)
Read and update scan_processing under mwifiex_cmd_lock so cancellation
cannot race with scan state changes. Skip scan completion when no scan
was active.
Signed-off-by: Vishal Gupta <vishal.gupta_1@philips.com>
---
drivers/net/wireless/marvell/mwifiex/scan.c | 34 ++++++++++++---------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c
index bdd4b8465863b..c2c5738d8a3fa 100644
--- a/drivers/net/wireless/marvell/mwifiex/scan.c
+++ b/drivers/net/wireless/marvell/mwifiex/scan.c
@@ -2059,26 +2059,32 @@ void mwifiex_cancel_scan(struct mwifiex_adapter *adapter)
{
struct mwifiex_private *priv;
int i;
+ bool cancel = false;
mwifiex_cancel_pending_scan_cmd(adapter);
+ spin_lock_bh(&adapter->mwifiex_cmd_lock);
if (adapter->scan_processing) {
- spin_lock_bh(&adapter->mwifiex_cmd_lock);
adapter->scan_processing = false;
- spin_unlock_bh(&adapter->mwifiex_cmd_lock);
- for (i = 0; i < adapter->priv_num; i++) {
- priv = adapter->priv[i];
- if (priv->scan_request) {
- struct cfg80211_scan_info info = {
- .aborted = true,
- };
+ cancel = true;
+ }
+ spin_unlock_bh(&adapter->mwifiex_cmd_lock);
- mwifiex_dbg(adapter, INFO,
- "info: aborting scan\n");
- cfg80211_scan_done(priv->scan_request, &info);
- priv->scan_request = NULL;
- priv->scan_aborting = false;
- }
+ if (!cancel)
+ return;
+
+ for (i = 0; i < adapter->priv_num; i++) {
+ priv = adapter->priv[i];
+ if (priv->scan_request) {
+ struct cfg80211_scan_info info = {
+ .aborted = true,
+ };
+
+ mwifiex_dbg(adapter, INFO,
+ "info: aborting scan\n");
+ cfg80211_scan_done(priv->scan_request, &info);
+ priv->scan_request = NULL;
+ priv->scan_aborting = false;
}
}
}
--
2.43.0
next reply other threads:[~2026-10-28 13:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 13:58 Vishal Gupta [this message]
2026-11-20 10:47 ` [PATCH v2] wifi: ath6kl: synchronize scan request completion Vishal Gupta
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=20261028135818.4166538-1-vishal.gupta_1@philips.com \
--to=vishal.gupta_1@philips.com \
--cc=briannorris@chromium.org \
--cc=francesco@dolcini.it \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®