From: Ping-Ke Shih <pkshih@realtek.com>
To: Enver Ikromov <owner@ph4ntom-rev.uz>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH rtw-next v5 10/10] wifi: rtw89: restore channel when leaving idle on non-chanctx devices
Date: Mon, 16 Nov 2026 03:45:04 +0000 [thread overview]
Message-ID: <ef6d8d689d88443e993d667e7a75d538@realtek.com> (raw)
In-Reply-To: <20261113235211.1911-11-owner@ph4ntom-rev.uz>
Enver Ikromov <owner@ph4ntom-rev.uz> wrote:
> rtw89_alloc_ieee80211_hw() disables native chanctx callbacks
> (ops->assign_vif_chanctx = NULL) and relies on mac80211 chanctx
> emulation via hw->conf.chandef and rtw89_ops_config() whenever
> chip->support_chanctx_num == 0 or the loaded firmware lacks
> SCAN_OFFLOAD or BEACON_FILTER (for example on RTL8852AE with firmware
> 0.13.36.2, where support_chanctx_num == 1 but BEACON_FILTER is absent).
>
> When the last monitor interface is brought down or deleted (or all
> interfaces become idle), rtw89_ops_stop() / rtw89_enter_ips() powers
> down the MAC/BB/RF and clears the RTW89_PHY_0 entity state while
> mac80211 retains local->hw.conf.chandef.
> When a monitor interface
> (including a concurrent MONITOR_FLAG_ACTIVE interface alongside an
> unassociated STA, where __ieee80211_recalc_idle() clears
> IEEE80211_CONF_IDLE without setting IEEE80211_CONF_MONITOR) is brought
> up on the same channel, rtw89_ops_start() sets RTW89_FLAG_POWERON
> without programming the channel (so rtw89_leave_ips() returns early),
> and ieee80211_hw_conf_chan() omits IEEE80211_CONF_CHANGE_CHANNEL
> because chandef is unchanged, leaving RX/TX silent until a manual
> channel change.
This should be the first paragraph to explain why you need this patch.
The commit message may just say that fix the channel in monitor doesn't
restore after monitor interface down/up.
The detail trace can be second paragraph or not necessary.
The LLM provide the trace is good to understand what/how it does, but
not suitable for commit message always.
Please rephrase commit message.
>
> In rtw89_ops_config(), when IEEE80211_CONF_CHANGE_IDLE or
> IEEE80211_CONF_CHANGE_MONITOR leaves the device non-idle on hardware
> without assign_vif_chanctx and RTW89_PHY_0 is not yet active, apply
> hw->conf.chandef and call rtw89_set_channel(). When
> IEEE80211_CONF_CHANGE_CHANNEL has already configured RTW89_PHY_0, the
> entity state check avoids redundant RF calibration.
>
> Signed-off-by: Enver Ikromov <owner@ph4ntom-rev.uz>
> ---
> drivers/net/wireless/realtek/rtw89/mac80211.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/net/wireless/realtek/rtw89/mac80211.c
> b/drivers/net/wireless/realtek/rtw89/mac80211.c
> index c8a6003..3649a7a 100644
> --- a/drivers/net/wireless/realtek/rtw89/mac80211.c
> +++ b/drivers/net/wireless/realtek/rtw89/mac80211.c
> @@ -152,6 +152,17 @@ static int rtw89_ops_config(struct ieee80211_hw *hw, int radio_idx, u32 changed)
> if (changed & IEEE80211_CONF_CHANGE_MONITOR)
> rtw89_physts_parsing_init(rtwdev);
>
> + if ((changed & (IEEE80211_CONF_CHANGE_IDLE |
> + IEEE80211_CONF_CHANGE_MONITOR)) &&
> + !(hw->conf.flags & IEEE80211_CONF_IDLE) &&
> + !rtwdev->ops->assign_vif_chanctx &&
This might be the first condition 'no_chanctx'.
Declare a local variable 'no_chanctx = !rtwdev->ops->assign_vif_chanctx';
Move this upward after rtw89_leave_ps_mode(), and update the 'changed'
changed |= IEEE80211_CONF_CHANGE_CHANNEL;
to share existing code.
bool no_chanctx = !rtwdev->ops->assign_vif_chanctx;
if (no_chanctx &&
(changed & (IEEE80211_CONF_CHANGE_IDLE | IEEE80211_CONF_CHANGE_MONITOR) ==
(IEEE80211_CONF_CHANGE_IDLE | IEEE80211_CONF_CHANGE_MONITOR)) {
if (!(hw->conf.flags & IEEE80211_CONF_IDLE))
changed |= IEEE80211_CONF_CHANGE_CHANNEL;
}
> + !rtw89_get_entity_state(rtwdev, RTW89_PHY_0) &&
> + cfg80211_chandef_valid(&hw->conf.chandef)) {
> + rtw89_config_entity_chandef(rtwdev, RTW89_CHANCTX_0,
> + &hw->conf.chandef);
> + rtw89_set_channel(rtwdev);
> + }
> +
> return 0;
> }
>
> --
> 2.56.0.windows.4
next prev parent reply other threads:[~2026-11-16 3:45 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 23:52 [PATCH rtw-next v5 00/10] wifi: rtw89: monitor mode RX filter and raw frame injection fixes Enver Ikromov
2026-11-13 23:52 ` [PATCH rtw-next v5 01/10] wifi: rtw89: avoid NULL vif dereference in rtw89_ops_tx() Enver Ikromov
2026-11-15 3:23 ` Ping-Ke Shih
2026-11-13 23:52 ` [PATCH rtw-next v5 02/10] wifi: rtw89: handle negative rate index for injected frames Enver Ikromov
2026-11-15 3:38 ` Ping-Ke Shih
2026-11-13 23:52 ` [PATCH rtw-next v5 03/10] wifi: rtw89: fix RX filter configuration for monitor mode Enver Ikromov
2026-11-15 3:48 ` Ping-Ke Shih
2026-11-13 23:52 ` [PATCH rtw-next v5 04/10] wifi: rtw89: protect pure_monitor_mode_vif with RCU Enver Ikromov
2026-11-15 4:00 ` Ping-Ke Shih
2026-11-13 23:52 ` [PATCH rtw-next v5 05/10] wifi: rtw89: use AP self role for monitor interfaces Enver Ikromov
2026-11-15 4:08 ` Ping-Ke Shih
2026-11-13 23:52 ` [PATCH rtw-next v5 06/10] wifi: rtw89: transmit frames from " Enver Ikromov
2026-11-16 1:35 ` Ping-Ke Shih
2026-11-13 23:52 ` [PATCH rtw-next v5 07/10] wifi: rtw89: send injected control frames through the management path Enver Ikromov
2026-11-16 2:14 ` Ping-Ke Shih
2026-11-13 23:52 ` [PATCH rtw-next v5 08/10] wifi: rtw89: skip host-side TX hooks for injected frames Enver Ikromov
2026-11-16 2:20 ` Ping-Ke Shih
2026-11-13 23:52 ` [PATCH rtw-next v5 09/10] wifi: rtw89: honor ASSIGN_SEQ, retries, and NO_ACK " Enver Ikromov
2026-11-16 3:00 ` Ping-Ke Shih
2026-11-13 23:52 ` [PATCH rtw-next v5 10/10] wifi: rtw89: restore channel when leaving idle on non-chanctx devices Enver Ikromov
2026-11-16 3:45 ` Ping-Ke Shih [this message]
2026-11-15 3:12 ` [PATCH rtw-next v5 00/10] wifi: rtw89: monitor mode RX filter and raw frame injection fixes Ping-Ke Shih
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=ef6d8d689d88443e993d667e7a75d538@realtek.com \
--to=pkshih@realtek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=owner@ph4ntom-rev.uz \
/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®