Re: [PATCH] wifi: rtw88: 8703b: Fix RX/TX issues

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

 



On Fri, Jan 3, 2025 at 1:13 AM Ping-Ke Shih <pkshih@xxxxxxxxxxx> wrote:
>
> Vasily Khoruzhick <anarsoul@xxxxxxxxx> wrote:
> > Fix 3 typos in 8703b driver. 2 typos in calibration routines are not
> > fatal and do not seem to have any impact, just fix them to match vendor
> > driver.
>
> Just curious how you can find these typos?

I added traces to sdio_* functions in linux (see [1]), so I can
capture register access traces. I captured the traces from both rtw88
and the vendor driver and wrote a simple parser that decodes the
traces, see [2]. I guess it would be easier with an USB device, where
we have usbmon. I really wish there was something like usbmon for
SDIO.

I also added traces for C2H messages to both drivers, since they go
through sdio_memcpy_fromio() that I don't trace.

Once I had the traces, I manually compared them (along with register
dumps, rtw88 has it in debugfs, vendor driver in proc) trying to find
the writes that do not match. Unfortunately, rtw88 and vendor driver
flows are different enough, so I couldn't come up with a way to
compare it automatically

Adrian and Bitterblue supported me on #linux-wireless on IRC, and one
of the typos in IQK calibration was actually found by Bitterblue.

It took ~5 evenings and 1 weekend to get to REG_OFDM0_TX_PSD_NOISE
(0xce4). Once I changed it from 0 to 0x10000000 via reg_write over
debugfs, it magically fixed the issue. I changed it back to 0 to
confirm that it breaks it again, and then back to 0x10000000 to see it
working. Then it was just a matter of grep to find where this register
is written in rtw88 and compare the corresponding code to the vendor
driver.

[1] https://github.com/anarsoul/rtl8723cs-re/blob/master/sdio_traces.patch
[2] https://github.com/anarsoul/rtl8723cs-re

> > However the last one in rtw8703b_set_channel_bb() clears too many bits
> > in REG_OFDM0_TX_PSD_NOISE, causing TX and RX issues (neither rate goes
> > above MCS0-MCS1). Vendor driver clears only 2 most significant bits.
> >
> > With the last typo fixed, the driver is able to reach MCS7 on Pinebook
> >
> > Cc: stable@xxxxxxxxxxxxxxx
> > Fixes: 9bb762b3a957 ("wifi: rtw88: Add definitions for 8703b chip")
> > Signed-off-by: Vasily Khoruzhick <anarsoul@xxxxxxxxx>
>
> Acked-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx>
>
> Is this urgent? If not, I will take this via rtw-next tree.

Not really, since there aren't not a lot of users of 8723cs, but it
makes rtw88_8723cs driver usable on rtl8723cs. I don't really have any
preference on what tree it goes in

Regards,
Vasily

>





[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux