armbian-build/patch/misc/rtw88/6.2/HACK/001-rtw88-SDIO-RX-aggregation-limiting.patch
Patrick Yavitz 61aee9857c patch: misc: rtw88: 6.1 / 6.2 / 6.3 / 6.4: backport updates
Patch set includes a complete backport of RTW88 as it currently stands, along with extras

Extra:
Patch: RTL8723DS (SDIO)
Patch: _rtw_download_firmware()  warn: missing unwind goto?

Hack: SDIO RX Aggregation Limiting
I only have two units available to me with an 8822CS module and in my testing this is only required on the BPI-CM4IO. With out LIMITING the unit will either kernel panic or not be able to send or receive.

This is currently being looked into:
https://lore.kernel.org/linux-wireless/CAFBinCBaXtebixKbjkWKW_WXc5k=NdGNaGUjVE8NCPNxOhsb2g@mail.gmail.com/T/#u

It may be possible to just set LIMITING across all builds, but that to me seems like a poor choice. This requires testing.

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
2023-06-19 22:06:47 +02:00

24 lines
1.1 KiB
Diff

Certain Amlogic SDIO host controllers have a limit of
receiving/transmitting at most 1536 bytes at a time.
It turns out that rtw_sdio_enable_rx_aggregation() from rtw88/sdio.c
is not taking this into account currently.
For any RX buffer that is bigger than 1536 bytes (which can happen due
to RX aggregation) we're unable to do any processing on the host side
because all bytes beyond the 1536 bytes mark are lost.
Lukas found that limiting BIT_RXDMA_AGG_PG_TH to 0x6 makes his
RTL8822CS work on the affected Amlogic SoCs.
diff -Naur a/drivers/net/wireless/realtek/rtw88/sdio.c b/drivers/net/wireless/realtek/rtw88/sdio.c
--- a/drivers/net/wireless/realtek/rtw88/sdio.c 2023-06-11 18:00:25.018357329 -0400
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c 2023-06-11 18:00:29.514273802 -0400
@@ -670,7 +670,7 @@
rtw_write8_set(rtwdev, REG_TXDMA_PQ_MAP, BIT_RXDMA_AGG_EN);
rtw_write16(rtwdev, REG_RXDMA_AGG_PG_TH,
- FIELD_PREP(BIT_RXDMA_AGG_PG_TH, size) |
+ FIELD_PREP(BIT_RXDMA_AGG_PG_TH, 0x6) |
FIELD_PREP(BIT_DMA_AGG_TO_V1, timeout));
rtw_write8_set(rtwdev, REG_RXDMA_MODE, BIT_DMA_MODE);