2023-07-27 01:58:53

by Ping-Ke Shih

[permalink] [raw]
Subject: RE: [PATCH] wifi: rtw88: sdio: Honor the host max_req_size in the RX path



> -----Original Message-----
> From: Martin Blumenstingl <[email protected]>
> Sent: Thursday, July 27, 2023 1:38 AM
> To: Ping-Ke Shih <[email protected]>
> Cc: Lukas F. Hartmann <[email protected]>; [email protected]; [email protected];
> [email protected]; [email protected]; [email protected]; [email protected]
> Subject: Re: [PATCH] wifi: rtw88: sdio: Honor the host max_req_size in the RX path
>
> Hello Ping-Ke,
>
> On Fri, Jul 14, 2023 at 2:34 AM Ping-Ke Shih <[email protected]> wrote:
> [...]
> > > Here are the errors that lead up to this:
> > > http://dump.mntmn.com/rtw88-failure-1h-dmesg.txt
> >
> > Hi Martin,
> >
> > The dmesg shows that
> > "rtw_8822cs mmc2:0001:1: Failed to read 1536 byte(s) from SDIO port 0x000000d1"
> >
> > Shouldn't we return an error code (with proper error handling) instead of
> > just break the loop? Because 'buf' content isn't usable.
> In my opinion we are properly breaking the loop:
> "ret" will be non-zero so the error code is returned from
> rtw_sdio_read_port() to the caller.
> The (only) caller is rtw_sdio_rxfifo_recv() which sees the non-zero
> return code and aborts processing.
> What do you think?

You are correct.

I check the kernel log again. It might try to read two times for a large packet.

First read is 1536 bytes, but it failed:
[ 4002.096664] rtw_8822cs mmc2:0001:1: Failed to read 1536 byte(s) from SDIO port 0x000000d1

Second read is less byte, and it succeed, but skb->data content is incorrect. Then,
[ 4002.100140] rtw_8822cs mmc2:0001:1: unused phy status page (3)
[ 4002.105065] rtw_8822cs mmc2:0001:1: unused phy status page (2)
[ 4002.110862] ------------[ cut here ]------------
[ 4002.110868] Rate marked as a VHT rate but data is invalid: MCS: 0, NSS: 0

So, showing total size ('count' argument) might help to find the cause
or a workaround.

Ping-Ke