mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] wifi: ath12k: report an aborted scan before cancel_hw_scan returns
@ 2026-11-10 21:34 Vladyslav Tymoshchuk
  0 siblings, 0 replies; only message in thread
From: Vladyslav Tymoshchuk @ 2026-11-10 21:34 UTC (permalink / raw)
  To: Jeff Johnson
  Cc: Aditya Kumar Singh, linux-wireless, ath12k, linux-kernel,
	Vladyslav Tymoshchuk

Suspending while a hardware scan is running makes mac80211 warn on
resume:

  phy0: resume with hardware scan still in progress
  WARNING: net/mac80211/ieee80211_i.h:2444 at ieee80211_resume+0x60/0x6c [mac80211]
  Call trace:
   ieee80211_resume+0x60/0x6c [mac80211] (P)
   wiphy_resume+0x84/0xdc [cfg80211]
   dpm_run_callback+0x40/0x124
   device_resume+0x154/0x1f8

__ieee80211_suspend() cancels the scan with ieee80211_scan_cancel(),
which for a hardware scan only calls the cancel_hw_scan() callback and
leaves it to the driver to call ieee80211_scan_completed().
ath12k_mac_op_cancel_hw_scan() waits for the firmware to stop the scan,
but ieee80211_scan_completed() is called from scan.vdev_clean_wk. That
is a wiphy work, and wiphy_suspend() has already run the pending wiphy
works before calling into mac80211, so the work only runs after the
resume and mac80211 finds the scan neither completed nor aborted.

Flush the work in ath12k_mac_op_cancel_hw_scan(), as
ath12k_mac_op_cancel_remain_on_channel() already does.

Tested-on: WCN7850 hw2.0 PCI WLAN.GNG.1.0-03342-QCAGNGSWPL_V1.0_V2.0_SILICONZ-1.81206.153

Fixes: 3863f014ad23 ("wifi: ath12k: symmetrize scan vdev creation and deletion during HW scan")
Signed-off-by: Vladyslav Tymoshchuk <tvlad744@gmail.com>
---
Reproduced with "iw dev wlp1s0 scan trigger" followed 0.3 s, 1 s and
2.5 s later by "rtcwake -m freeze -s 20" on a OnePlus Pad 3 (SM8750,
WCN7880 hw2.0), associated to an AP:

  without the patch    3/3 suspends warn
  with the patch       0/3

After the runs with the patch the interface is still associated and a
new scan returns results.

I tested on a 7.3-rc5 based tree with out-of-tree patches for this
device. The function is the same in ath-next; I applied the patch there
but did not build or run that tree.

I used an AI assistant (Claude) for the analysis and to draft this
patch and its description; I reviewed the result and ran the tests on
my device.

 drivers/net/wireless/ath/ath12k/mac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 9fd3841f71b7..d4c1f7cd7040 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -5875,6 +5875,7 @@ void ath12k_mac_op_cancel_hw_scan(struct ieee80211_hw *hw,
 		ath12k_scan_abort(ar);
 
 		cancel_delayed_work_sync(&ar->scan.timeout);
+		wiphy_work_flush(hw->wiphy, &ar->scan.vdev_clean_wk);
 	}
 }
 EXPORT_SYMBOL(ath12k_mac_op_cancel_hw_scan);

base-commit: d0fbb39d65dc9dcb4175fa6b23e473dec3670f4d
-- 
2.43.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-10 21:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-10 21:34 [PATCH] wifi: ath12k: report an aborted scan before cancel_hw_scan returns Vladyslav Tymoshchuk

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®