mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jun ASAKA <JunASAKA@zzy040330.moe>
To: Ping-Ke Shih <pkshih@realtek.com>,
	"Jes.Sorensen@gmail.com" <Jes.Sorensen@gmail.com>
Cc: "kvalo@kernel.org" <kvalo@kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] wifi: rtl8xxxu: fixing IQK failures for rtl8192eu
Date: Thu, 1 Dec 2022 09:38:40 +0800	[thread overview]
Message-ID: <6ce2e648-9c12-56a1-9118-e1e18c7ecd7d@zzy040330.moe> (raw)
In-Reply-To: <663e6d79c34f44998a937fe9fbd228e9@realtek.com>

On 01/12/2022 8:54 am, Ping-Ke Shih wrote:

>
>> -----Original Message-----
>> From: JunASAKA <JunASAKA@zzy040330.moe>
>> Sent: Wednesday, November 30, 2022 10:09 PM
>> To: Jes.Sorensen@gmail.com
>> Cc: kvalo@kernel.org; davem@davemloft.net; edumazet@google.com; kuba@kernel.org; pabeni@redhat.com;
>> linux-wireless@vger.kernel.org; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; JunASAKA
>> <JunASAKA@zzy040330.moe>
>> Subject: [PATCH] wifi: rtl8xxxu: fixing IQK failures for rtl8192eu
>>
>> Fixing "Path A RX IQK failed" and "Path B RX IQK failed"
>> issues for rtl8192eu chips by replacing the arguments with
>> the ones in the updated official driver.
> I think it would be better if you can point out which version you use, and
> people will not modify them back to old version suddenly.
>
>> Signed-off-by: JunASAKA <JunASAKA@zzy040330.moe>
>> ---
>>   .../realtek/rtl8xxxu/rtl8xxxu_8192e.c         | 76 +++++++++++++------
>>   1 file changed, 54 insertions(+), 22 deletions(-)
>>
>> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
>> b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
>> index b06508d0cd..82346500f2 100644
>> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
>> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
> [...]
>
>> @@ -891,22 +907,28 @@ static int rtl8192eu_iqk_path_b(struct rtl8xxxu_priv *priv)
>>
>>   	rtl8xxxu_write32(priv, REG_FPGA0_IQK, 0x00000000);
>>   	rtl8xxxu_write_rfreg(priv, RF_B, RF6052_REG_UNKNOWN_DF, 0x00180);
>> -	rtl8xxxu_write32(priv, REG_FPGA0_IQK, 0x80800000);
>>
>> -	rtl8xxxu_write32(priv, REG_FPGA0_IQK, 0x00000000);
>> +	rtl8xxxu_write_rfreg(priv, RF_B, RF6052_REG_WE_LUT, 0x800a0);
>> +	rtl8xxxu_write_rfreg(priv, RF_B, RF6052_REG_RCK_OS, 0x20000);
>> +	rtl8xxxu_write_rfreg(priv, RF_B, RF6052_REG_TXPA_G1, 0x0000f);
>> +	rtl8xxxu_write_rfreg(priv, RF_B, RF6052_REG_TXPA_G2, 0x07f77);
>> +
>>   	rtl8xxxu_write32(priv, REG_FPGA0_IQK, 0x80800000);
>>
>> +	// rtl8xxxu_write32(priv, REG_FPGA0_IQK, 0x00000000);
>> +	// rtl8xxxu_write32(priv, REG_FPGA0_IQK, 0x80800000);
>> +
> I think this is a test code of vendor driver. No need them here.
>
>
>>   	/* Path B IQK setting */
>>   	rtl8xxxu_write32(priv, REG_TX_IQK_TONE_A, 0x38008c1c);
>>   	rtl8xxxu_write32(priv, REG_RX_IQK_TONE_A, 0x38008c1c);
>>   	rtl8xxxu_write32(priv, REG_TX_IQK_TONE_B, 0x18008c1c);
>>   	rtl8xxxu_write32(priv, REG_RX_IQK_TONE_B, 0x38008c1c);
>>
>> -	rtl8xxxu_write32(priv, REG_TX_IQK_PI_B, 0x821403e2);
>> +	rtl8xxxu_write32(priv, REG_TX_IQK_PI_B, 0x82140303);
>>   	rtl8xxxu_write32(priv, REG_RX_IQK_PI_B, 0x68160000);
>>
>>   	/* LO calibration setting */
>> -	rtl8xxxu_write32(priv, REG_IQK_AGC_RSP, 0x00492911);
>> +	rtl8xxxu_write32(priv, REG_IQK_AGC_RSP, 0x00462911);
>>
>>   	/* One shot, path A LOK & IQK */
>>   	rtl8xxxu_write32(priv, REG_IQK_AGC_PTS, 0xfa000000);
> [...]
>
> I have compared your patch with internal code, and they are the same.
> But, I don't have a test.
>
> Ping-Ke

I changed those arguments into the ones here: 
https://github.com/Mange/rtl8192eu-linux-driver which works fine with my 
rtl8192eu wifi dongle. But forgive my ignorant that I don't have enough 
experience on wifi drivers, I just compared those two drivers and 
figured that those codes fixing my IQK failures.

I tested it on my PC (fedora 37 with kernel v6.1.0-rc7) with my 
rtl8192eu device and it works well.


Jun ASAKA.



  reply	other threads:[~2022-12-01  1:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30 14:08 JunASAKA
2022-12-01  0:54 ` Ping-Ke Shih
2022-12-01  1:38   ` Jun ASAKA [this message]
2022-12-01  2:18     ` Ping-Ke Shih
2022-12-01  2:28       ` Jun ASAKA
2022-12-01 13:09       ` Bitterblue Smith
2022-12-01 14:20         ` Jun ASAKA

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=6ce2e648-9c12-56a1-9118-e1e18c7ecd7d@zzy040330.moe \
    --to=junasaka@zzy040330.moe \
    --cc=Jes.Sorensen@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pkshih@realtek.com \
    /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

all inboxes | Powered by JetHome®