Search Linux Wireless

rtw88: Problem with sdio.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Martin,

When I applied your latest changes to my rtw88 repo, the driver for 8723ds broke. The dmesg log first showed things like:

[    3.603884] rtw_8723ds mmc1:0001:1: Firmware version 48.0.0, H2C version 0
[    3.615430] sunxi-mmc 4021000.mmc: unaligned scatterlist: os e80 length 2
[    3.622248] sunxi-mmc 4021000.mmc: map DMA failed
[    3.626974] rtw_8723ds mmc1:0001:1: sdio read16 failed (0x10040): -22
[    3.633435] sunxi-mmc 4021000.mmc: unaligned scatterlist: os e80 length 2
[    3.640236] sunxi-mmc 4021000.mmc: map DMA failed

There were similar messages for write16 operations.

I was able to "fix" the problem by turning off rea16/write16 operations for the RTW8723DS with the following patch that uses the rtw_chip_wcpu_11n() function:

diff --git a/sdio.c b/sdio.c
index 1647cdc..2051c30 100644
--- a/sdio.c
+++ b/sdio.c
@@ -87,7 +87,7 @@ static void rtw_sdio_writew(struct rtw_dev *rtwdev, u16 val, u32 addr,
        u8 buf[2];
        int i;

-       if (rtw_sdio_use_memcpy_io(rtwdev, addr, 2)) {
+       if (rtw_sdio_use_memcpy_io(rtwdev, addr, 2) && !rtw_chip_wcpu_11n(rtwdev)) {
                sdio_writew(rtwsdio->sdio_func, val, addr, err_ret);
                return;
        }
@@ -125,7 +125,7 @@ static u16 rtw_sdio_readw(struct rtw_dev *rtwdev, u32 addr, int *err_ret)
        u8 buf[2];
        int i;

-       if (rtw_sdio_use_memcpy_io(rtwdev, addr, 2))
+       if (rtw_sdio_use_memcpy_io(rtwdev, addr, 2) && !rtw_chip_wcpu_11n(rtwdev))
                return sdio_readw(rtwsdio->sdio_func, addr, err_ret);

        for (i = 0; i < 2; i++) {

This leaves 16-bit reads and write enabled for the other chips. Alternatives would be to detect when this particular SDIO controller is in use, or last of all, add a module parameter.

Larry



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux