[PATCH RFC wireless-next 0/2] wifi: wl18xx: Stop querying the firmware statistics
From: Patrick Fischer via B4 Relay
Date: Fri Nov 13 2026 - 14:21:07 EST
On a WL1801 (Tegra Note 7, firmware 8.9.0.0.83) the answer to
ACX_STATISTICS overwrites both event mailboxes. struct
wl18xx_acx_statistics is 1100 bytes, the command mailbox 740 bytes,
and the two 180-byte event mailboxes sit right behind it
(0xb007f8, +740, +920 on this chip). An event that is waiting in a
mailbox while the statistics are read is then handled with statistics
counters as its vector and data. I ran into it as a NULL pointer
dereference in wlcore_event_rssi_trigger() with a P2P device; the fix
for that crash went out separately earlier today [1].
What I measured, with a test kernel that logs the mailbox addresses and
can change the requested length at run time:
- idle, chip memory read through debugfs "mem" before and after one
query: the pipeline counters (bytes 952-1000 of the statistics) show
up in event mailbox B after every query, also when only 740 bytes are
requested. The firmware ignores the requested length.
- 600 s iperf3 upload with the statistics read once a second: 50 bogus
RSSI trigger events with 1100 bytes, 24 with 740 bytes, all from
mailbox B and all with statistics content. Without the statistics
reads: none.
So the only fix I see on the host side is not to send ACX_STATISTICS
on wl18xx at all, which is what this series does. Patch 1 lets wlcore
run without firmware statistics, patch 2 drops them from wl18xx.
Why RFC:
- It removes the wl18xx fw_stats debugfs files. If someone knows a
firmware setting or version where the command mailbox is big enough,
or another way to get the statistics, I would rather do that.
- I kept the statistics structures in wl18xx/acx.h as documentation of
the firmware interface. I can drop them as well.
- Should patch 2 go to stable? It fixes corrupted events, but only for
people who read the debugfs statistics.
Tested on the same Tegra Note 7 with v7.3 plus these two patches (the
touched files are the same in v7.3 and wireless-next): wl18xx/fw_stats,
clear_fw_stats and fw_stats_raw are gone, the other debugfs files are
still there; unloading and reloading wl18xx works and the station
reassociates. The same 600 s iperf3 upload, with the monitoring script
still trying to read the statistics once a second, ran at 46.7 Mbit/s
with no RSSI trigger event, no oops, no recovery and 0 failed frames.
Build-tested with W=1 for arm (gcc, clang) and arm64 (clang).
[1] https://lore.kernel.org/r/20261113-upstream-wlcore-p2p-rssi-v1-1-754bd625daca@xxxxxxxxxxxxxxxxxx
Tool use (see Documentation/process/generated-content.rst): these
patches, the changelogs and this letter were prepared with an LLM
coding assistant (Claude Code). It worked out the mailbox layout from
the driver source and my logs, wrote the test tooling, the changes and
the texts from my measurements and instructions. I reviewed the
changes and ran the tests on the device.
---
Patrick Fischer (2):
wifi: wlcore: Allow lower drivers without firmware statistics
wifi: wl18xx: Stop querying the firmware statistics
drivers/net/wireless/ti/wl18xx/acx.c | 24 ---
drivers/net/wireless/ti/wl18xx/acx.h | 5 -
drivers/net/wireless/ti/wl18xx/debugfs.c | 333 +------------------------------
drivers/net/wireless/ti/wl18xx/main.c | 1 -
drivers/net/wireless/ti/wlcore/debugfs.c | 18 +-
5 files changed, 14 insertions(+), 367 deletions(-)
---
base-commit: 5dbf2415ca9821a611d09308e3b29d2c37e7cd77
change-id: 20261111-upstream-wl18xx-fw-stats-c70d96addfc9
Best regards,
--
Patrick Fischer <admin@xxxxxxxxxxxxxxxxxx>