lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+E=qVfsHw_YqwVNPjhp9QydC9RUo=9U6ddA6StrmDNzgrUCxQ@mail.gmail.com>
Date: Fri, 3 Jan 2025 09:30:39 -0800
From: Vasily Khoruzhick <anarsoul@...il.com>
To: Ping-Ke Shih <pkshih@...ltek.com>
Cc: Kalle Valo <kvalo@...nel.org>, Fiona Klute <fiona.klute@....de>, 
	Bitterblue Smith <rtl8821cerfe2@...il.com>, 
	"linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>, 
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, 
	"stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: Re: [PATCH] wifi: rtw88: 8703b: Fix RX/TX issues

On Fri, Jan 3, 2025 at 1:13 AM Ping-Ke Shih <pkshih@...ltek.com> wrote:
>
> Vasily Khoruzhick <anarsoul@...il.com> 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@...r.kernel.org
> > Fixes: 9bb762b3a957 ("wifi: rtw88: Add definitions for 8703b chip")
> > Signed-off-by: Vasily Khoruzhick <anarsoul@...il.com>
>
> Acked-by: Ping-Ke Shih <pkshih@...ltek.com>
>
> 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

>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ