[Bug 298238] [rtw88] RTL8822CE TX ring stall under load, hw_scan returns -16, requires full poweroff to recover
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 298238] [rtw88] RTL8822CE TX ring stall under load, hw_scan returns -16, requires full poweroff to recover"
- Reply: bugzilla-noreply_a_freebsd.org: "[Bug 298238] [rtw88] RTL8822CE TX ring stall under load, hw_scan returns -16, requires full poweroff to recover"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 06 Sep 2026 09:58:28 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298238
Bug ID: 298238
Summary: [rtw88] RTL8822CE TX ring stall under load, hw_scan
returns -16, requires full poweroff to recover
Product: Base System
Version: 15.1-RELEASE
Hardware: amd64
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: wireless
Assignee: wireless@FreeBSD.org
Reporter: llmhater@protonmail.com
I have spent about a week debugging an RTL8822CE on FreeBSD 15.1-RELEASE and
narrowed the problem down to a specific pattern. I would appreciate any
feedback from developers familiar with the LinuxKPI-rtw88 driver internals.
System:
1) OS: FreeBSD 15.1-RELEASE amd64
2) Laptop: HP (locked-down UEFI, no ASPM/PCIe power management options exposed)
3) CPU/GPU: AMD Ryzen 7 4900U
4) Storage: NVMe, GELI-encrypted ZFS root
5) WiFi card: Realtek RTL8822CE (if_rtw88.ko)
6) Firmware: wifi-firmware-rtw88-kmod package
7) Dual-boot: Artix Linux + FreeBSD via rEFInd
pciconf output:
vendor = Realtek Semiconductor Co., Ltd.
device = RTL8822CE 802.11ac PCIe Wireless Network Adapter
cap 05[50] = MSI supports 1 message, 64 bit enabled with 1 message
cap 10[70] = PCI-Express 2 endpoint
link x1(x1) speed 2.5(2.5) ASPM L1(L0s/L1) ClockPM enabled
Available sysctl tunables for rtw88:
compat.linuxkpi.rtw88_pci_disable_aspm: 0
compat.linuxkpi.rtw88_pci_disable_msi: 0
compat.linuxkpi.rtw88_support_vht: 0 # disabled by default
compat.linuxkpi.rtw88_support_ht: 0 # disabled by default
compat.linuxkpi.rtw88_disable_lps_deep: 0
compat.linuxkpi.rtw88_support_bf: 1
compat.linuxkpi.rtw88_debug_mask: 0
Current working /boot/loader.conf (kernel + Lua booted from ESP due to GELI
root):
hw.pci.enable_aspm="0"
dev.pcie.aspm="0"
hw.pci.enable_pcie_pm="0"
hw.dmar.enable="0"
hw.amdiommu.enable="0"
machdep.disable_pci_dmar="1"
compat.linuxkpi.rtw88_support_ht="1" # required, see "Note on driver defaults"
below
compat.linuxkpi.rtw88_support_vht="0" # VHT on causes even faster crashes under
load
compat.linuxkpi.rtw88_disable_lps_deep="1"
compat.linuxkpi.rtw88_pci_disable_aspm="1"
compat.linuxkpi.rtw88_pci_disable_msi="0" # MSI must be ON for TX to work
net.link.ifqmaxlen="1024"
/etc/rc.conf (relevant part):
ifconfig_wlan0="WPA SYNCDHCP"
With the above config:
1) Light traffic works perfectly. Long-running pings (ping 1.1.1.1) work for
hours.
2) Card associates immediately and gets DHCP.
3) tcpdump -i wlan0 shows incoming multicast/broadcast traffic all the time (RX
is rock-solid).
4) vmstat -i shows irq72: rtw880 firing continuously (MSI works).
The failure mode: TX ring stall under sustained TCP load
Trigger: any traffic that opens many parallel TCP connections. Reproducibly
killed by:
pkg install <any package>
Sequence of events:
1) First few seconds: download proceeds slowly.
2) "resolver failure: transient" starts appearing (DNS timeouts).
3) Concurrent ping from another terminal starts hanging.
4) dmesg fills with:
rtw880: error beacon valid
rtw880: download probe request to firmware failed
rtw880: update probe request failed
rtw880: HW scan failed with status: -16
lkpi_ic_scan_start: hw_scan returned -16
5) TX is completely dead. ifconfig wlan0 still shows "associated" but no
packets go out.
6) wpa_supplicant restart or ifconfig wlan0 down/up returns:
Failed to write rsvd page data
Failed to download firmware
lkpi_ic_vap_create: failed to start hw: -16
7) The card typically requires a full poweroff to recover. Warm reboot behavior
varies: sometimes the card comes back briefly, sometimes stays broken. I
haven't systematically tested this, but full poweroff + a few seconds of wait
always works.
What doesn't fix it (already tried extensively):
1) compat.linuxkpi.rtw88_pci_disable_msi="1" (legacy INTx) -> TX stalls after
4-5 ping packets even at idle.
2) compat.linuxkpi.rtw88_support_vht="1" -> crashes even faster under load.
3) Fixing PHY rate: ifconfig wlan0 media OFDM/6Mbps up to OFDM/54Mbps or
OFDM/54Mbps down to OFDM/6Mbps -> doesn't prevent crash under pkg install.
4) ifconfig wlan0 -bgscan completely breaks connectivity, pings stop going
through immediately, not just under load. Apparently the driver requires
periodic scans to maintain the association. Unfortunate, because hw_scan
failed: -16 under load is the primary failure mode.
5) ifconfig wlan0 roaming manual -> no visible effect.
6) ifconfig wlan0 sndq <N> -> always returns "bad value" on wlan clones.
7) Shrinking TCP buffers (net.inet.tcp.sendspace=8192 etc.) -> causes "No
buffer space available" immediately on any traffic, doesn't help.
8) Disabling HW offloading (ifconfig wlan0 -txcsum -rxcsum -tso -lro) -> no
effect on the stall.
9) kldunload if_rtw88 after crash -> kernel panic (Fatal trap 12: page fault in
kernel mode). Looks like a LinuxKPI null-deref bug on unload after firmware
failure.
Note on driver defaults:
Both compat.linuxkpi.rtw88_support_ht and compat.linuxkpi.rtw88_support_vht
default to 0.
With HT=0 and VHT=0, the card's behavior is highly inconsistent. Depending on
other tunables (MSI on/off, ASPM, etc.) and seemingly random factors, I
observed the full spectrum of outcomes: from completely non-functional
(associates but TX is dead, no pings go through at all), to passing only a
handful of packets before the hw_scan failed: -16 firmware crash, to
occasionally working fully (including successful pkg install) - but never
reliably or for long, always eventually crashing with the same errors.
Setting rtw88_support_ht="1" made the baseline behavior significantly more
stable and predictable under light traffic (long-running pings work for hours),
though the TX stall under heavy load still occurs.
This default (HT/VHT off) may make sense for cheap USB dongles that misbehave
under HT, but on PCIe cards like RTL8822CE it produces unstable,
hard-to-diagnose behavior. Worth reconsidering the default for PCIe variants,
or at least documenting the tunable clearly.
What I think is happening:
Two-part problem, both driver-side:
1) Something in the rtw88 driver forces a scan/probe-request cycle even during
active TX. Under sustained load this scan collides with the TX ring and
firmware panics (hw_scan failed: -16 -> error beacon valid). Disabling bgscan
breaks the association entirely, so it is not a viable workaround.
2) After the firmware panic, the PCIe/DMA state on the card is left in a
"half-loaded" state. The card requires a full power cycle to recover cleanly.
kldunload panics the kernel (NULL deref in LinuxKPI unload path).
Questions:
1) Since -bgscan kills the association entirely, is there another way to
prevent hw_scan from colliding with active TX? Some kind of scan-throttling or
"only scan when idle" tunable?
2) Are there any pending patches or in-flight commits for hw_scan/probe_request
handling on RTL8822CE in FreeBSD 15.1?
3) Would setting compat.linuxkpi.rtw88_debug_mask to a non-zero value give
useful debug output? What bits are meaningful?
4) Is anyone else running RTL8822CE successfully on 15.1 under heavy TCP load?
What tunables?
5) Is there a way to force a PCIe secondary bus reset from userspace (like
Linux echo 1 > /sys/bus/pci/devices/.../reset) so I can recover the card
without a full poweroff?
Additional observation:
One more thing that's driving me crazy: with the exact same loader.conf, same
rc.conf, and same conditions (same AP, same distance, same time of day), I
sometimes get 5 successful pings before the crash, sometimes 20, sometimes it
dies immediately, and very rarely it survives a full pkg install. This
inconsistency makes me suspect a race condition somewhere in the driver's
scan/TX scheduling, but I have no way to prove it.
If any additional diagnostic data is needed, I can collect whatever is
required.
--
You are receiving this mail because:
You are the assignee for the bug.