Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH rtw-next v3 0/2] wifi: rtw88: 8822c: fix cck_pd_set when the chip stops responding
@ 2026-11-15 20:18 Zeshan Ahmed Nobin
  2026-11-15 20:18 ` [PATCH rtw-next v3 1/2] wifi: rtw88: 8822c: fix out-of-bounds access in cck_pd_set Zeshan Ahmed Nobin
  2026-11-15 20:18 ` [PATCH rtw-next v3 2/2] wifi: rtw88: 8822c: ignore nrx values without CCK PD registers Zeshan Ahmed Nobin
  0 siblings, 2 replies; 4+ messages in thread
From: Zeshan Ahmed Nobin @ 2026-11-15 20:18 UTC (permalink / raw)
  To: linux-wireless; +Cc: linux-kernel, Ping-Ke Shih, Luka Gejak, Kalle Valo

rtw8822c_phy_cck_pd_set() indexes its tables with two values read from
the chip, bw and nrx. When the chip stops responding, both can be
invalid; on PCIe, register reads then return all ones, so both are 3.

Patch 1 takes bw from rtwdev->hal.current_band_width instead, as Luka
Gejak suggested, which fixes the out-of-bounds access. Patch 2 makes the
function ignore nrx values without CCK PD registers, which Luka found
while reviewing v1.

The two belong together. With patch 1 alone, bw is always valid, so on
PCIe a chip that stops responding gets past the WARN_ON() in
rtw8822c_phy_cck_pd_set_reg() and reaches the zero-mask register access
that patch 2 prevents. Patch 2 indexes rtw8822c_cck_pd_reg[] with bw, so
it needs patch 1 first. Both are marked for stable.

v3:
- Patch 1: take bw from hal instead of reading it from the chip, and
  drop the check (Luka)
- Patch 1: replace the forced-bw test, which no longer applies, with
  real chip failures (Luka); add a check of hal against the register
- Patch 2: update the message and notes for the change in patch 1
  (Luka)
- Patch 2: add Cc: stable, since with patch 1 a chip that stops
  responding on PCIe reaches the zero-mask access
- Patch 2: add Luka's Reviewed-by; the code is unchanged
- Keep the order, and say here that the two belong together (Luka)

v2: https://lore.kernel.org/all/20261108182837.682661-1-zeshanahmednobin@gmail.com/
v1: https://lore.kernel.org/linux-wireless/20261105113415.73184-1-zeshanahmednobin@gmail.com/

AI assistance: I asked an AI coding assistant to help find out why the
RTL8822CE in my laptop keeps failing. It analyzed the kernel logs and
found the bw bug (Luka found the nrx one and suggested the approach in
patch 1), wrote the code, the debug-only changes used for testing, and
the messages. I reviewed everything and ran the tests described in each
patch before sending.

Zeshan Ahmed Nobin (2):
  wifi: rtw88: 8822c: fix out-of-bounds access in cck_pd_set
  wifi: rtw88: 8822c: ignore nrx values without CCK PD registers

 drivers/net/wireless/realtek/rtw88/rtw8822c.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)


base-commit: 04c9984187228904f222681661c50db3f0c50b71
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-16 14:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-15 20:18 [PATCH rtw-next v3 0/2] wifi: rtw88: 8822c: fix cck_pd_set when the chip stops responding Zeshan Ahmed Nobin
2026-11-15 20:18 ` [PATCH rtw-next v3 1/2] wifi: rtw88: 8822c: fix out-of-bounds access in cck_pd_set Zeshan Ahmed Nobin
2026-11-16 14:49   ` Luka Gejak
2026-11-15 20:18 ` [PATCH rtw-next v3 2/2] wifi: rtw88: 8822c: ignore nrx values without CCK PD registers Zeshan Ahmed Nobin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox