From: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
To: jjohnson@kernel.org
Cc: ath11k@lists.infradead.org, ath12k@lists.infradead.org,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
Subject: [PATCH v2 2/3] wifi: ath12k: prevent scan during firmware recovery
Date: Tue, 4 Aug 2026 19:50:00 +0200 [thread overview]
Message-ID: <20260804175004.1761075-3-jtornosm@redhat.com> (raw)
In-Reply-To: <20260804175004.1761075-1-jtornosm@redhat.com>
When firmware crashes while wpa_supplicant has an active connection,
wpa_supplicant may immediately attempt a scan via nl80211 while the
firmware is still powering on through MHI. ath12k_mac_op_hw_scan()
proceeds without checking the recovery state, accessing partially
initialized radio structures which leads to a NULL pointer dereference:
BUG: unable to handle page fault for address: 0000000000001508
RIP: ath12k_mac_op_hw_scan+0x148/0x2b0 [ath12k]
Call Trace:
drv_hw_scan+0x88/0x140 [mac80211]
__ieee80211_start_scan+0x2bc/0x6b0 [mac80211]
nl80211_trigger_scan+0x54a/0x9f0 [cfg80211]
Fix by checking ATH12K_FLAG_RECOVERY at the start of
ath12k_mac_op_hw_scan() and returning -EBUSY. mac80211 will retry the
scan after the recovery completes.
Tested on WCN7850 with MLO (Wi-Fi 7).
Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
---
v2: Fix radio[0] usage
v1: https://lore.kernel.org/all/20260727162748.963275-3-jtornosm@redhat.com/
drivers/net/wireless/ath/ath12k/mac.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 7b7110ca6428..a57c2e91be84 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -5783,6 +5783,11 @@ int ath12k_mac_op_hw_scan(struct ieee80211_hw *hw,
lockdep_assert_wiphy(hw->wiphy);
+ for_each_ar(ah, ar, i) {
+ if (test_bit(ATH12K_FLAG_RECOVERY, &ar->ab->dev_flags))
+ return -EBUSY;
+ }
+
chan_list = kzalloc_objs(*chan_list, hw_req->req.n_channels);
if (!chan_list)
return -ENOMEM;
--
2.54.0
next prev parent reply other threads:[~2026-08-04 17:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 17:49 [PATCH v2 0/3] wifi: ath12k: fixes to improve MLO station stability Jose Ignacio Tornos Martinez
2026-08-04 17:49 ` [PATCH v2 1/3] wifi: ath12k: fix MLO station firmware crash recovery Jose Ignacio Tornos Martinez
2026-08-04 17:50 ` Jose Ignacio Tornos Martinez [this message]
2026-08-04 17:50 ` [PATCH v2 3/3] wifi: ath12k: skip connection_loss_work for MLO beacon miss Jose Ignacio Tornos Martinez
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=20260804175004.1761075-3-jtornosm@redhat.com \
--to=jtornosm@redhat.com \
--cc=ath11k@lists.infradead.org \
--cc=ath12k@lists.infradead.org \
--cc=jjohnson@kernel.org \
--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