From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=211.75.126.72 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796286652; b=owEwJvfhMFvLW458Kevce5tlqKYZZZSZHegniBDFXmiwdJ5VO8G4Y2aG8SAiB7W2uVe1 diVVSm7imPn6trFva6sxRlwm27AxxBIptwuwhaW50cI9NW03ZOWa4yeSI5KS8v3ggjvRc 8r1ZnsJz4RmEfA+acqc3mSkWKcDIsH/O1xtKXwhxSR0Wi66cvH7gdVyp9gwMcxYr+jbag 963bo0cbfEpi3tZcWloPfV1pQ0n/iNNpQ7ktekr71agSqyDWmE73eMiN2imOd0A47d9HT WcsHMNoEB+dZYshFZmFwCNyoPiDBmsimnt2Cu16y+8XbOVO0/5Uvbh/S1GzdNYx52cQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796286652; h=DMARC-Filter:X-SpamFilter-By:DKIM-Signature:Received:Received: Received:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID: References:In-Reply-To:Accept-Language:Content-Language: x-originating-ip:Content-Type:Content-Transfer-Encoding:MIME-Version; bh=HALYesOR4VuD9MM43h4ndgdNahm4MoZ0A46D88LKyDY=; b=P7zjWvbz+4LyL6qUhZzc8ejujhLyaMWW4U1u/EpnUjJ5MnxIgKPT7KQule6QKE7IrBXB wPN8WJshMBIB5MwgFieXm8qcCmbOxRomx6GM3PviRmBGwSyftpCbMiS+bwCAyRVNbH3LN 06XgYOJ338E4wqediS9eKYhn3+X9KT6FnA3sEir5688z1kxPGxBbT2yTZCAnn3aUXGkiP 0PmydNo/09ckuz80Ahv8djDGsyYyF9hm6dpFq/IOyNB9q5g/ADs1tGZilU5+npRULOZGB k0aPFnfvlbAByGqjWFFbRJGm5vgfznf+OuqCmkNxx0YTHM7sxlKe0egvt3TDloThYVQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=pass header.d=realtek.com header.i=@realtek.com header.a=rsa-sha256 header.s=dkim header.b=TXxInWj8; arc=none smtp.remote-ip=211.75.126.72 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67EC7606A322; Thu, 3 Dec 2026 08:30:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 67EC7606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=realtek.com header.i=@realtek.com header.a=rsa-sha256 header.s=dkim header.b=TXxInWj8 X-SpamFilter-By: ArmorX SpamTrap 5.80 with qID 6B38UBgnC1766849, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=realtek.com; s=dkim; t=1796286611; bh=HALYesOR4VuD9MM43h4ndgdNahm4MoZ0A46D88LKyDY=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:Content-Transfer-Encoding:MIME-Version; b=TXxInWj80yEJw0Srqo0JMLTFNFcQRE3dzDh7l7KAGEx07TvS6GJcr3tlmI5eEfrIM Y0E3TtehQxrICT+T49YFOaVeX5SYbFO6sdzNUcddXUqeeuD9SKSuodEsLBlFswBV7C fVVVofF7C0kNy7NlVVEPkNfGTeU0/XzVqREpOnDzapnwBFacWrixtZPxCXKORZta8W ME2rkzZaQ9k52tZ7b3TlpXeJ0T6MEUrCGEtCG4rI7zcXjmjZR7X+UWm6er+ZUPNXZg IMB17um3ldB1/Ucvej54g8rHHMDrIuiUpbtNyA9aWH0okyWGvFrcO/8lWPzxI0miQE VE3Qpv2BJiuYw== Received: from mail.realtek.com (rtkexhmbs03.realtek.com.tw[10.21.1.53]) by rtits2.realtek.com.tw (8.15.2/3.29/5.94) with ESMTPS id 6B38UBgnC1766849 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 3 Dec 2026 16:30:11 +0800 Received: from RTKEXHMBS06.realtek.com.tw (10.21.1.56) by RTKEXHMBS03.realtek.com.tw (10.21.1.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.56; Thu, 3 Dec 2026 16:30:11 +0800 Received: from RTKEXHMBS06.realtek.com.tw ([fe80::eeeb:c765:ca73:5eef]) by RTKEXHMBS06.realtek.com.tw ([fe80::eeeb:c765:ca73:5eef%10]) with mapi id 15.02.2562.056; Thu, 3 Dec 2026 16:30:11 +0800 From: Ping-Ke Shih To: Martin CC: "linux-wireless@vger.kernel.org" , "Luka Gejak" , Bitterblue Smith , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH rtw-next] wifi: rtw88: restore channel when leaving idle in monitor mode Thread-Topic: [PATCH rtw-next] wifi: rtw88: restore channel when leaving idle in monitor mode Thread-Index: AQHdgvz44UQwHbyonk2u4q3izYdlJ7dK933w Date: Thu, 3 Dec 2026 08:30:10 +0000 Message-ID: <1f0c7ac6270c49d9b6c2da9ec9dbee22@realtek.com> References: <20261203080413.37311-1-martin@rfdeck.de> In-Reply-To: <20261203080413.37311-1-martin@rfdeck.de> Accept-Language: en-US, zh-TW Content-Language: zh-TW Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Martin wrote: > After a monitor interface is set up a second time on the same channel > (down, monitor, up, same frequency), the chip no longer works on that > channel. On 5 GHz the RTL8814AU neither receives nor transmits, and > the RTL8812AU does not transmit. Setting up the interface on a > different channel works. I think this is enough. >=20 > Stopping the last interface powers the chip off, but mac80211 keeps > the chandef. When the interface comes up again on the same channel, > ieee80211_hw_conf_init() does not set IEEE80211_CONF_CHANGE_CHANNEL, > so rtw_ops_config() does not call rtw_set_channel() after the chip > was powered on. The RF and baseband settings stay at their init > values; on the RTL8814AU the RFE pinmux keeps the value from the > baseband init table. No need to describe your trace. I think the Closes link gives much things already. >=20 > Like rtw89 commit e07c9af7bbc8 ("wifi: rtw89: restore channel when > leaving idle on non-chanctx devices"), set > IEEE80211_CONF_CHANGE_CHANNEL when a monitor interface leaves idle, so > the channel is programmed again. rtw88 does not use the chanctx > callbacks, so no check for that is needed. Just put this after "---".=20 But actually, I guess Closes link has this too.=20 >=20 > Closes: > https://lore.kernel.org/linux-wireless/20261201205032.Horde.Z7ChCCtVnG0Km= e7KFHo6v7B@mail.your-serv > er.de/ > Suggested-by: Ping-Ke Shih > Signed-off-by: Martin > --- > Tested with an RTL8814AU and an RTL8812AU (USB)=20 It is worth to put the tested adapters in commit message.=20 > on Ubuntu 7.0.0-43, > with the same hunk applied to its rtw88 (stock mac80211). After the > second setup on 5180 MHz at 80 MHz width, the RTL8814AU receives as > many beacons as after the first setup (none without the change), and > both adapters inject again (50 of 50 frames at a second receiver). > The same holds for a second setup on 5200 MHz, for deleting and > re-adding the monitor interface, for down/up without changing the > interface type, and for restarting Kismet. No warnings in dmesg. The > patch applies to rtw-next as is; I did not build rtw-next itself. >=20 > Luka Gejak traced the problem to ieee80211_hw_conf_init(). Calling > rtw_set_channel() in rtw_ops_start() and setting > IEEE80211_CONF_CHANGE_CHANNEL in ieee80211_hw_conf_init() fix it too; > this version follows rtw89, as Ping-Ke preferred. >=20 > AI tool use (Documentation/process/generated-content.rst): the > analysis, the patch and the changelog were written with help from > Claude Code, from the register dumps and mac80211 traces of my tests > and the discussion on the list. I reviewed and tested the change. >=20 > drivers/net/wireless/realtek/rtw88/mac80211.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) >=20 > diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c > b/drivers/net/wireless/realtek/rtw88/mac80211.c > index b14d7fffb98..97ec7609a23 100644 > --- a/drivers/net/wireless/realtek/rtw88/mac80211.c > +++ b/drivers/net/wireless/realtek/rtw88/mac80211.c > @@ -86,6 +86,16 @@ static int rtw_ops_config(struct ieee80211_hw *hw, int= radio_idx, u32 changed) >=20 > rtw_leave_lps_deep(rtwdev); >=20 > + /* The chip was powered off while mac80211 kept the chandef, so a > + * monitor interface that comes up again on the same channel does > + * not get IEEE80211_CONF_CHANGE_CHANNEL. Program the channel any= way. > + */ No need this comment.=20 > + if (changed & IEEE80211_CONF_CHANGE_IDLE && > + changed & IEEE80211_CONF_CHANGE_MONITOR && > + !(hw->conf.flags & IEEE80211_CONF_IDLE) && > + hw->conf.flags & IEEE80211_CONF_MONITOR) > + changed |=3D IEEE80211_CONF_CHANGE_CHANNEL; > + > if ((changed & IEEE80211_CONF_CHANGE_IDLE) && > !(hw->conf.flags & IEEE80211_CONF_IDLE)) { > ret =3D rtw_leave_ips(rtwdev); > -- > 2.43.0 >=20