* [PATCH] wifi: mac80211: skip reconfiguration when the last emulated chanctx goes
@ 2026-08-29 10:15 Nerijus Bendžiūnas
2026-09-03 17:35 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Nerijus Bendžiūnas @ 2026-08-29 10:15 UTC (permalink / raw)
To: Johannes Berg, linux-wireless; +Cc: linux-kernel
Drivers without native channel contexts get the emulated ops, and
ieee80211_emulate_remove_chanctx() reconfigures the hardware with no
context left, which ieee80211_calc_hw_conf_chan() turns into a channel
change to the default channel. A monitor-mode retune releases its
context before using the next one, so every retune costs the driver two
channel changes: one to the default channel and one to the channel that
was asked for. Nothing is on the air without a context and the next
context sets the channel, so drop that reconfiguration; the radar flag
is still cleared for the next configuration to carry.
On an AR9271 (ath9k_htc), where every channel change is a full reset
over USB, hopping across the 13 standard 2.4 GHz channels with an
unmodified driver showed 2006 drv_config CHANGE_CHANNEL calls for 1000
hops with the reconfiguration and 1006 without, a median hop of 123.5 ms
against 92.0 ms (p95 183 ms against 105 ms), and 99.1% against 98.3% of
injected frames delivered on a second card.
Signed-off-by: Nerijus Bendžiūnas <nerijus.bendziunas@gmail.com>
---
net/mac80211/main.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index a59837b9f480..b3f9b3bc3cac 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -289,9 +289,14 @@ void ieee80211_emulate_remove_chanctx(struct ieee80211_hw *hw,
{
struct ieee80211_local *local = hw_to_local(hw);
+ /*
+ * With no context left there is nothing to configure: nothing is on
+ * the air, and the next context sets the channel. Parking the radio
+ * on the default channel here only to move it again when the next
+ * context is added costs drivers without native channel contexts a
+ * full channel change per retune.
+ */
local->hw.conf.radar_enabled = false;
-
- _ieee80211_hw_conf_chan(local, NULL);
}
EXPORT_SYMBOL(ieee80211_emulate_remove_chanctx);
base-commit: ca800a9302764c445de0da0e84d2252400a770ee
--
2.55.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] wifi: mac80211: skip reconfiguration when the last emulated chanctx goes
2026-08-29 10:15 [PATCH] wifi: mac80211: skip reconfiguration when the last emulated chanctx goes Nerijus Bendžiūnas
@ 2026-09-03 17:35 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2026-09-03 17:35 UTC (permalink / raw)
To: Nerijus Bendžiūnas, linux-wireless; +Cc: linux-kernel
On Sat, 2026-08-29 at 13:15 +0300, Nerijus Bendžiūnas wrote:
> Drivers without native channel contexts get the emulated ops, and
> ieee80211_emulate_remove_chanctx() reconfigures the hardware with no
> context left, which ieee80211_calc_hw_conf_chan() turns into a channel
> change to the default channel. A monitor-mode retune releases its
> context before using the next one, so every retune costs the driver two
> channel changes: one to the default channel and one to the channel that
> was asked for. Nothing is on the air without a context and the next
> context sets the channel, so drop that reconfiguration; the radar flag
> is still cleared for the next configuration to carry.
>
> On an AR9271 (ath9k_htc), where every channel change is a full reset
> over USB, hopping across the 13 standard 2.4 GHz channels with an
> unmodified driver showed 2006 drv_config CHANGE_CHANNEL calls for 1000
> hops with the reconfiguration and 1006 without, a median hop of 123.5 ms
> against 92.0 ms (p95 183 ms against 105 ms), and 99.1% against 98.3% of
> injected frames delivered on a second card.
>
> Signed-off-by: Nerijus Bendžiūnas <nerijus.bendziunas@gmail.com>
You're expected to disclose LLM usage.
https://www.kernel.org/doc/html/latest/process/coding-assistants.html
And please clean up the wordering everywhere before submitting again.
johannes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-03 17:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-29 10:15 [PATCH] wifi: mac80211: skip reconfiguration when the last emulated chanctx goes Nerijus Bendžiūnas
2026-09-03 17:35 ` Johannes Berg
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®