public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: Chih-Kang Chang <gary.chang@realtek.com>,
	Ping-Ke Shih <pkshih@realtek.com>,
	Sasha Levin <sashal@kernel.org>,
	linux-wireless@vger.kernel.org
Subject: [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: setting TBTT AGG number when mac port initialization
Date: Sat, 14 Feb 2026 16:22:45 -0500	[thread overview]
Message-ID: <20260214212452.782265-20-sashal@kernel.org> (raw)
In-Reply-To: <20260214212452.782265-1-sashal@kernel.org>

From: Chih-Kang Chang <gary.chang@realtek.com>

[ Upstream commit 5e5f83fba48381098b26a8b2513a6d5fc5c66ccb ]

When initializing mac port, needs to set TBTT AGG number to trigger TBTT
related interrupts. Otherwise, after sending join info H2C command with
disconnection mode, firmware will clear TBTT AGG number. Without the
setting from mac port initialization after that, this port will not be
able to transmit beacons.

Signed-off-by: Chih-Kang Chang <gary.chang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20251223030651.480633-12-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

The `tbtt_agg` field has been part of the port register structure since
the initial driver addition. The register mask `B_AX_TBTT_AGG_NUM_MASK`
also exists. This means all necessary infrastructure is already in
stable trees.

### User Impact

This affects users running the rtw89 WiFi driver (Realtek 802.11ax
cards) in AP mode or any mode that requires beacon transmission. After a
disconnect/reconnect cycle, beacons stop being transmitted, making the
wireless interface non-functional for AP operations. This is a
significant functionality loss.

### Assessment

**Meets stable criteria:**
- **Obviously correct**: The function follows the exact same trivial
  pattern as all other port config functions
- **Fixes a real bug**: Beacon transmission failure after
  disconnect/reconnect
- **Small and contained**: ~15 lines, 1 file, mechanical pattern
- **No new features**: This restores expected behavior (setting a
  hardware register during initialization)
- **No new APIs**: Internal driver change only
- **Low risk**: Uses existing register definitions and write helpers

**Concerns:**
- The commit is part of a series (patch 12 of a series based on the
  Link), but it appears self-contained - it only adds a new function and
  calls it. No dependencies on other patches in the series.
- The code is simple and the pattern is well-established in this driver.

The fix is small, surgical, restores critical WiFi AP functionality, and
follows established patterns in the driver. It meets all stable kernel
criteria.

**YES**

 drivers/net/wireless/realtek/rtw89/mac.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
index b4c292c7e829d..6734e5d5a5e22 100644
--- a/drivers/net/wireless/realtek/rtw89/mac.c
+++ b/drivers/net/wireless/realtek/rtw89/mac.c
@@ -4341,6 +4341,7 @@ static void rtw89_mac_bcn_drop(struct rtw89_dev *rtwdev,
 #define BCN_HOLD_DEF 200
 #define BCN_MASK_DEF 0
 #define TBTT_ERLY_DEF 5
+#define TBTT_AGG_DEF 1
 #define BCN_SET_UNIT 32
 #define BCN_ERLY_SET_DLY (10 * 2)
 
@@ -4644,6 +4645,16 @@ static void rtw89_mac_port_cfg_tbtt_early(struct rtw89_dev *rtwdev,
 				B_AX_TBTTERLY_MASK, TBTT_ERLY_DEF);
 }
 
+static void rtw89_mac_port_cfg_tbtt_agg(struct rtw89_dev *rtwdev,
+					struct rtw89_vif_link *rtwvif_link)
+{
+	const struct rtw89_mac_gen_def *mac = rtwdev->chip->mac_def;
+	const struct rtw89_port_reg *p = mac->port_base;
+
+	rtw89_write16_port_mask(rtwdev, rtwvif_link, p->tbtt_agg,
+				B_AX_TBTT_AGG_NUM_MASK, TBTT_AGG_DEF);
+}
+
 static void rtw89_mac_port_cfg_bss_color(struct rtw89_dev *rtwdev,
 					 struct rtw89_vif_link *rtwvif_link)
 {
@@ -4904,6 +4915,7 @@ int rtw89_mac_port_update(struct rtw89_dev *rtwdev, struct rtw89_vif_link *rtwvi
 	rtw89_mac_port_cfg_bcn_hold_time(rtwdev, rtwvif_link);
 	rtw89_mac_port_cfg_bcn_mask_area(rtwdev, rtwvif_link);
 	rtw89_mac_port_cfg_tbtt_early(rtwdev, rtwvif_link);
+	rtw89_mac_port_cfg_tbtt_agg(rtwdev, rtwvif_link);
 	rtw89_mac_port_cfg_bss_color(rtwdev, rtwvif_link);
 	rtw89_mac_port_cfg_mbssid(rtwdev, rtwvif_link);
 	rtw89_mac_port_cfg_func_en(rtwdev, rtwvif_link, true);
-- 
2.51.0


  parent reply	other threads:[~2026-02-14 21:25 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-14 21:22 [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: ser: enable error IMR after recovering from L1 Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.12] wifi: ath11k: Fix failure to connect to a 6 GHz AP Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.1] wifi: rtw88: 8822b: Avoid WARNING in rtw8822b_config_trx_mode() Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: 8922a: add digital compensation for 2GHz Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: pci: validate sequence number of TX release report Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-5.10] wifi: iwlegacy: add missing mutex protection in il4965_store_tx_power() Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.6] wifi: rtw88: rtw8821cu: Add ID for Mercusys MU6H Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: Add support for MSI AX1800 Nano (GUAX18N) Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: mcc: reset probe counter when receiving beacon Sasha Levin
2026-02-14 21:22 ` Sasha Levin [this message]
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: disable EHT protocol by chip capabilities Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-5.10] wifi: ath10k: fix lock protection in ath10k_wmi_event_peer_sta_ps_state_chg() Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.12] wifi: cfg80211: allow only one NAN interface, also in multi radio Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.6] wifi: ath12k: fix preferred hardware mode calculation Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.1] wifi: rtw88: fix DTIM period handling when conf->dtim_period is zero Sasha Levin
2026-02-14 21:22 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: mac: correct page number for CSI response Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw88: Fix inadvertent sharing of struct ieee80211_supported_band data Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19] wifi: rtw89: 8852au: add support for TP TX30U Plus Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.6] wifi: ath11k: add pm quirk for Thinkpad Z13/Z16 Gen1 Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19] wifi: rtw89: Add default ID 28de:2432 for RTL8832CU Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.18] wifi: ath12k: fix mac phy capability parsing Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.1] wifi: rtw89: pci: restore LDO setting after device resume Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-5.10] wifi: iwlegacy: add missing mutex protection in il3945_store_measurement() Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19] wifi: rtw89: Add support for D-Link VR Air Bridge (DWA-F18) Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.6] wifi: rtw89: wow: add reason codes for disassociation in WoWLAN mode Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: fix unable to receive probe responses under MLO connection Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: regd: 6 GHz power type marks default when inactive Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19] wifi: cfg80211: treat deprecated INDOOR_SP_AP_OLD control value as LPI mode Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw88: Use devm_kmemdup() in rtw_set_supported_band() Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-5.10] wifi: libertas: fix WARNING in usb_tx_block Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: pci: validate release report content before using for RTL8922DE Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.12] wifi: rtw89: 8922a: set random mac if efuse contains zeroes Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-6.18] wifi: rtw89: fix potential zero beacon interval in beacon tracking Sasha Levin

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=20260214212452.782265-20-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=gary.chang@realtek.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=pkshih@realtek.com \
    --cc=stable@vger.kernel.org \
    /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