stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Vasily Khoruzhick <anarsoul@gmail.com>
Cc: Kalle Valo <kvalo@kernel.org>, Fiona Klute <fiona.klute@gmx.de>,
	Bitterblue Smith <rtl8821cerfe2@gmail.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: RE: [PATCH] wifi: rtw88: 8703b: Fix RX/TX issues
Date: Mon, 6 Jan 2025 00:31:41 +0000	[thread overview]
Message-ID: <01c7887bce5a4c3fade980464c155b27@realtek.com> (raw)
In-Reply-To: <CA+E=qVfsHw_YqwVNPjhp9QydC9RUo=9U6ddA6StrmDNzgrUCxQ@mail.gmail.com>

Vasily Khoruzhick <anarsoul@gmail.com> wrote:
> 
> On Fri, Jan 3, 2025 at 1:13 AM Ping-Ke Shih <pkshih@realtek.com> wrote:
> >
> > Vasily Khoruzhick <anarsoul@gmail.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
> 

Cool. I did similar works when we rewrite rtw89 from vendor drivers.
Sometimes we also found flaws of vendor driver by their difference. 

Ping-Ke


  reply	other threads:[~2025-01-06  0:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-03  7:50 [PATCH] wifi: rtw88: 8703b: Fix RX/TX issues Vasily Khoruzhick
2025-01-03  9:12 ` Ping-Ke Shih
2025-01-03 11:55   ` Fiona Klute
2025-01-03 19:12     ` Vasily Khoruzhick
2025-01-03 17:30   ` Vasily Khoruzhick
2025-01-06  0:31     ` Ping-Ke Shih [this message]
2025-01-03 19:02 ` Andrey Skvortsov
2025-01-03 19:10   ` Vasily Khoruzhick
2025-01-03 20:19     ` Andrey Skvortsov
2025-01-03 20:53       ` Vasily Khoruzhick
2025-01-03 22:57         ` Andrey Skvortsov
2025-01-12  2:02 ` Ping-Ke Shih

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=01c7887bce5a4c3fade980464c155b27@realtek.com \
    --to=pkshih@realtek.com \
    --cc=anarsoul@gmail.com \
    --cc=fiona.klute@gmx.de \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rtl8821cerfe2@gmail.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).