Hi Jeff,
On Fri, Mar 21, 2025 at 10:49:16AM +0100, Johan Hovold wrote:
Users of the Lenovo ThinkPad X13s have reported that Wi-Fi sometimes breaks and the log fills up with errors like:
ath11k_pci 0006:01:00.0: HTC Rx: insufficient length, got 1484, expected 1492 ath11k_pci 0006:01:00.0: HTC Rx: insufficient length, got 1460, expected 1484
which based on a quick look at the driver seemed to indicate some kind of ring-buffer corruption.
Miaoqing Pan tracked it down to the host seeing the updated destination ring head pointer before the updated descriptor, and the error handling for that in turn leaves the ring buffer in an inconsistent state.
Add the missing memory barrier to make sure that the descriptor is read after the head pointer to address the root cause of the corruption while fixing up the error handling in case there are ever any (ordering) bugs on the device side.
Note that the READ_ONCE() are only needed to avoid compiler mischief in case the ring-buffer helpers are ever inlined.
Tested-on: WCN6855 hw2.1 WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.41
Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218623 Link: https://lore.kernel.org/20250310010217.3845141-3-quic_miaoqing@quicinc.com Cc: Miaoqing Pan quic_miaoqing@quicinc.com Cc: stable@vger.kernel.org # 5.6 Signed-off-by: Johan Hovold johan+linaro@kernel.org
This patch fixes a long-standing issue that is hurting user of machines like the X13s, but as far as I can tell it has not been picked up yet (perhaps due to the temporary MAINTAINERS glitch that caused the wireless list not to be CCed?).
Would be good to get this fixed in 6.15 and backported to stable.
The following related patches are also not yet in linux-next:
https://lore.kernel.org/lkml/20250321145302.4775-1-johan+linaro@kernel.org/ https://lore.kernel.org/lkml/20250321095219.19369-1-johan+linaro@kernel.org/
Note that I still intend to sending follow-on fixes for the other missing barriers, but I'm a bit short on time at the moment.
Johan