* [PATCH ath-current 0/2] wifi: ath9k_htc: start ANI for an AP interface at the right time
@ 2026-10-05 7:22 Mehmet Fide
2026-10-05 7:22 ` [PATCH ath-current 1/2] wifi: ath9k_htc: do not start ANI before the first channel is set Mehmet Fide
2026-10-05 7:22 ` [PATCH ath-current 2/2] wifi: ath9k_htc: start ANI when an AP interface begins to beacon Mehmet Fide
0 siblings, 2 replies; 3+ messages in thread
From: Mehmet Fide @ 2026-10-05 7:22 UTC (permalink / raw)
To: Toke Høiland-Jørgensen
Cc: Jeff Johnson, linux-wireless, linux-kernel, mehmet.fide
From: Mehmet Fide <mehmet.fide@screeningeagle.com>
ath9k_htc starts ANI for an AP interface in add_interface, before a
channel and the calibration data exist. When the bring-up stalls
between add_interface and the first channel configuration, the first
ANI tick dereferences a NULL ah->caldata and the device does not
recover. Patch 1 removes that start. Patch 2 starts ANI once the
interface beacons, which is where ath9k_htc_vif_reconfig() already
re-arms it after a channel change; without it ANI and the periodic
calibration never ran during a normal AP start.
Tested with AR9271 on 6.18.48 and on a 6.12 product kernel: the oops
reproduces on every start with a 500 ms delay after add_interface and
is gone with the series; an hour as an AP, station mode, a channel
switch, hostapd disable/enable and a restart are clean.
Mehmet Fide (2):
wifi: ath9k_htc: do not start ANI before the first channel is set
wifi: ath9k_htc: start ANI when an AP interface begins to beacon
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--
2.55.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH ath-current 1/2] wifi: ath9k_htc: do not start ANI before the first channel is set
2026-10-05 7:22 [PATCH ath-current 0/2] wifi: ath9k_htc: start ANI for an AP interface at the right time Mehmet Fide
@ 2026-10-05 7:22 ` Mehmet Fide
2026-10-05 7:22 ` [PATCH ath-current 2/2] wifi: ath9k_htc: start ANI when an AP interface begins to beacon Mehmet Fide
1 sibling, 0 replies; 3+ messages in thread
From: Mehmet Fide @ 2026-10-05 7:22 UTC (permalink / raw)
To: Toke Høiland-Jørgensen
Cc: Jeff Johnson, linux-wireless, linux-kernel, mehmet.fide
From: Mehmet Fide <mehmet.fide@screeningeagle.com>
ath9k_htc_add_interface() starts ANI for the first AP interface, before
any channel is configured. The per-channel calibration data only gets
attached by the first ath9k_htc_set_channel() that is not a fast
channel change, and that same call cancels the ANI work a few
milliseconds after add_interface, so normally the work never runs.
When the bring-up stalls for more than the 100 ms ANI poll interval in
between, it does run, and ar9002_hw_per_calibration() records the IQ
calibration result in the calibration data that does not exist yet:
Unable to handle kernel NULL pointer dereference at virtual address
00000008
PC is at ar9002_hw_calibrate+0x1f8/0x570 [ath9k_hw]
Workqueue: phy0 ath9k_htc_ani_work [ath9k_htc]
Seen about once per thousand AP starts with an AR9271 on a Cortex-A5
board that starts hostapd while still booting; a 500 ms delay after
add_interface reproduces it on every start. The crashed work never
completes, so the next cancel_delayed_work_sync() blocks for good.
Drop the start; it has nothing to calibrate against and is cancelled
anyway. The TSF adjust bit that shared its condition is now set for
every AP interface, which is harmless: the next reset applies it. The
next patch starts ANI once the interface beacons.
Fixes: a236254c35f0 ("ath9k_htc: Add ANI for AP mode")
Cc: stable@vger.kernel.org
Signed-off-by: Mehmet Fide <mehmet.fide@screeningeagle.com>
---
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 0d6272ac0dac..a86dd28b0ab7 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1098,11 +1098,8 @@ static int ath9k_htc_add_interface(struct ieee80211_hw *hw,
ath9k_htc_set_opmode(priv);
- if ((priv->ah->opmode == NL80211_IFTYPE_AP) &&
- !test_bit(ATH_OP_ANI_RUN, &common->op_flags)) {
+ if (priv->ah->opmode == NL80211_IFTYPE_AP)
ath9k_hw_set_tsfadjust(priv->ah, true);
- ath9k_htc_start_ani(priv);
- }
ath_dbg(common, CONFIG, "Attach a VIF of type: %d at idx: %d\n",
vif->type, avp->index);
--
2.55.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH ath-current 2/2] wifi: ath9k_htc: start ANI when an AP interface begins to beacon
2026-10-05 7:22 [PATCH ath-current 0/2] wifi: ath9k_htc: start ANI for an AP interface at the right time Mehmet Fide
2026-10-05 7:22 ` [PATCH ath-current 1/2] wifi: ath9k_htc: do not start ANI before the first channel is set Mehmet Fide
@ 2026-10-05 7:22 ` Mehmet Fide
1 sibling, 0 replies; 3+ messages in thread
From: Mehmet Fide @ 2026-10-05 7:22 UTC (permalink / raw)
To: Toke Høiland-Jørgensen
Cc: Jeff Johnson, linux-wireless, linux-kernel, mehmet.fide
From: Mehmet Fide <mehmet.fide@screeningeagle.com>
ath9k_htc_vif_reconfig() re-arms ANI after a channel change when an AP
interface beacons. mac80211 configures the channel before it enables
the beacon, so during a normal AP start that never triggers, and the
start from add_interface that the previous patch removed was cancelled
by the same channel configuration: with hostapd, ANI and the periodic
calibration it drives did not run in AP mode until a later channel
change.
Start ANI when the beacon is enabled. The channel and its calibration
data are in place by then, which is the state vif_reconfig() re-arms
it in, and remove_interface() already stops it with the last AP
interface.
Fixes: a236254c35f0 ("ath9k_htc: Add ANI for AP mode")
Signed-off-by: Mehmet Fide <mehmet.fide@screeningeagle.com>
---
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index a86dd28b0ab7..6578114a4019 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1551,6 +1551,9 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw,
ath9k_htc_set_tsfadjust(priv, vif);
priv->cur_beacon_conf.enable_beacon = 1;
ath9k_htc_beacon_config(priv, vif);
+ if (priv->ah->opmode == NL80211_IFTYPE_AP &&
+ !test_bit(ATH_OP_ANI_RUN, &common->op_flags))
+ ath9k_htc_start_ani(priv);
}
if ((changed & BSS_CHANGED_BEACON_ENABLED) && !bss_conf->enable_beacon) {
--
2.55.0
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-05 7:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-05 7:22 [PATCH ath-current 0/2] wifi: ath9k_htc: start ANI for an AP interface at the right time Mehmet Fide
2026-10-05 7:22 ` [PATCH ath-current 1/2] wifi: ath9k_htc: do not start ANI before the first channel is set Mehmet Fide
2026-10-05 7:22 ` [PATCH ath-current 2/2] wifi: ath9k_htc: start ANI when an AP interface begins to beacon Mehmet Fide
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®