From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=188.40.28.6 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796285078; b=CmRX05L8eq0pmudL6jXEERL7W1HAJHo74P8HNllaZCL7e02P/reVk3R0d7+frnRDxgd9 hmG6iFsE4eMEJG5Il2up3H7736FcJCNBmX0bjYEUc8NpA2NRJyleLUhAC6SXDmUx8g2kq +E6ZJzBn/PAAyDmz+SePv1NPBjNeu6iObB5VfBk36BDwtHpFYMiJ8MOmaaY5Cn/iP0Wa2 Jmv/znBGRK9HXDeVCJzW+DymGS3Qe6wC8CEyvUzAeDzy3y0TUzjEVFbZ+gCEOZyX9/Ou/ 7oHzGScdyfaG3i+smTxpxneKRWzKIg65IdB5KuAK1zqmlcFMG0ZLXdQq4flMndARVQQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796285078; h=DMARC-Filter:DKIM-Signature:Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding: X-Virus-Scanned; bh=GRnJ9qiFhx469SOWeVDoQSwMU0nH2VdU3CLaZRtZgEk=; b=00KEjI7IqaksYrvZITTqrw3zSQ6Y0yOGXhRVu+uMtoKf0cI6cCLX/o15CULfZnTT5EDw u94zlRqB5FLp8t7+Mccj8gxPg2OLpEbt3R3QXYoWCKCCLFjlH5IADoxWxUxcxKdynwHNa c8CwOf53AyOJn5a06xRFWAA74iRws0Ria08Vpve8nQRn/qNdNT94RA7POA0faAOOeDYm8 t6F0ty2YJ+6crgJStnY1HGlI7AHO4rPiPzr7teOE5YlgZRjfte+DeZaMgiyg9AK41+rn4 yHO8xX5w//D8hLxMINj35kG/+9B2g570RqXe1649WmSwTjDytG5gW7su+6I6F6qMAtA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=rfdeck.de; spf=pass smtp.mailfrom=rfdeck.de; dkim=pass header.d=rfdeck.de header.i=@rfdeck.de header.a=rsa-sha256 header.s=default2609 header.b=PcoW6B6U; arc=none smtp.remote-ip=188.40.28.6 Received: from www226.your-server.de (www226.your-server.de [188.40.28.6]) (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 BB60C606A32C; Thu, 3 Dec 2026 08:04:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BB60C606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rfdeck.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rfdeck.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rfdeck.de header.i=@rfdeck.de header.a=rsa-sha256 header.s=default2609 header.b=PcoW6B6U DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rfdeck.de; s=default2609; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date: Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=GRnJ9qiFhx469SOWeVDoQSwMU0nH2VdU3CLaZRtZgEk=; b=PcoW6B6U4hpngxCImrI+QS/P57 9DMZpwTkpnYAH1WNgRlCu5oFudzp0YNuItMsahwFMP30BwP+x4362vcKvhdPDiX2WYQyFVlL5H7t5 tlU3mkNZEHBDCskePGuKyWJdmjlPPOmMKLBcOF0iSQFMBBSjT2qo0WZZw5rCwrCylsr8v9JNyp0qy S18kFAsZCnB527/hr9fETtW9jg+2JxyLX7kyT/ohoHQKc7BFQu6LnhVyq5Zg//ROeeNVAcbykC+gy 3nVUOv1n+NBoduWfNf74+7F5hZQKiWWziXT58W4BYEUiJX58qKOldS3AJwKQczIdiow32UQd2LpVF VgWLMdUA==; Received: from sslproxy08.your-server.de ([78.47.166.52]) by www226.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1xZ1nv-0004DG-1B; Thu, 03 Dec 2026 09:04:35 +0100 Received: from localhost ([127.0.0.1]) by sslproxy08.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1xZ1nu-000G1S-37; Thu, 03 Dec 2026 09:04:35 +0100 From: Martin To: Ping-Ke Shih Cc: linux-wireless@vger.kernel.org, Luka Gejak , Bitterblue Smith , linux-kernel@vger.kernel.org, Martin Subject: [PATCH rtw-next] wifi: rtw88: restore channel when leaving idle in monitor mode Date: Thu, 3 Dec 2026 09:04:13 +0100 Message-ID: <20261203080413.37311-1-martin@rfdeck.de> X-Mailer: git-send-email 2.43.0 X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Clear (ClamAV 1.4.7/28199/Wed Dec 2 07:27:10 2026) 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. 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. 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. Closes: https://lore.kernel.org/linux-wireless/20261201205032.Horde.Z7ChCCtVnG0Kme7KFHo6v7B@mail.your-server.de/ Suggested-by: Ping-Ke Shih Signed-off-by: Martin --- Tested with an RTL8814AU and an RTL8812AU (USB) 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. 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. 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. drivers/net/wireless/realtek/rtw88/mac80211.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) rtw_leave_lps_deep(rtwdev); + /* 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 anyway. + */ + if (changed & IEEE80211_CONF_CHANGE_IDLE && + changed & IEEE80211_CONF_CHANGE_MONITOR && + !(hw->conf.flags & IEEE80211_CONF_IDLE) && + hw->conf.flags & IEEE80211_CONF_MONITOR) + changed |= IEEE80211_CONF_CHANGE_CHANNEL; + if ((changed & IEEE80211_CONF_CHANGE_IDLE) && !(hw->conf.flags & IEEE80211_CONF_IDLE)) { ret = rtw_leave_ips(rtwdev); -- 2.43.0