diff mbox series

[v2] wifi: rtw89: 8852b: adjust quota to avoid SER L1 caused by access null page

Message ID 20230426034737.24870-1-pkshih@realtek.com (mailing list archive)
State Accepted
Commit c0426c446d92023d344131d01d929bc25db7a24e
Delegated to: Kalle Valo
Headers show
Series [v2] wifi: rtw89: 8852b: adjust quota to avoid SER L1 caused by access null page | expand

Commit Message

Ping-Ke Shih April 26, 2023, 3:47 a.m. UTC
Though SER can recover this case, traffic can get stuck for a while. Fix it
by adjusting page quota to avoid hardware access null page of CMAC/DMAC.

Fixes: a1cb097168fa ("wifi: rtw89: 8852b: configure DLE mem")
Fixes: 3e870b481733 ("wifi: rtw89: 8852b: add HFC quota arrays")
Cc: stable@vger.kernel.org
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://github.com/lwfinger/rtw89/issues/226#issuecomment-1520776761
Link: https://github.com/lwfinger/rtw89/issues/240
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
v2: add Fixes, Cc and Tested-by tags suggested by Larry.
---
 drivers/net/wireless/realtek/rtw89/mac.c      |  4 +++
 drivers/net/wireless/realtek/rtw89/mac.h      |  2 ++
 drivers/net/wireless/realtek/rtw89/rtw8852b.c | 28 +++++++++----------
 3 files changed, 20 insertions(+), 14 deletions(-)

Comments

Kalle Valo April 26, 2023, 5:10 a.m. UTC | #1
Ping-Ke Shih <pkshih@realtek.com> writes:

> Though SER can recover this case, traffic can get stuck for a while. Fix it
> by adjusting page quota to avoid hardware access null page of CMAC/DMAC.
>
> Fixes: a1cb097168fa ("wifi: rtw89: 8852b: configure DLE mem")
> Fixes: 3e870b481733 ("wifi: rtw89: 8852b: add HFC quota arrays")
> Cc: stable@vger.kernel.org
> Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
> Link: https://github.com/lwfinger/rtw89/issues/226#issuecomment-1520776761
> Link: https://github.com/lwfinger/rtw89/issues/240
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
> ---
> v2: add Fixes, Cc and Tested-by tags suggested by Larry.

Should this go to wireless tree for v6.4?
Ping-Ke Shih April 26, 2023, 5:16 a.m. UTC | #2
> -----Original Message-----
> From: Kalle Valo <kvalo@kernel.org>
> Sent: Wednesday, April 26, 2023 1:10 PM
> To: Ping-Ke Shih <pkshih@realtek.com>
> Cc: stable@vger.kernel.org; Larry.Finger@lwfinger.net; linux-wireless@vger.kernel.org
> Subject: Re: [PATCH v2] wifi: rtw89: 8852b: adjust quota to avoid SER L1 caused by access null page
> 
> Ping-Ke Shih <pkshih@realtek.com> writes:
> 
> > Though SER can recover this case, traffic can get stuck for a while. Fix it
> > by adjusting page quota to avoid hardware access null page of CMAC/DMAC.
> >
> > Fixes: a1cb097168fa ("wifi: rtw89: 8852b: configure DLE mem")
> > Fixes: 3e870b481733 ("wifi: rtw89: 8852b: add HFC quota arrays")
> > Cc: stable@vger.kernel.org
> > Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
> > Link: https://github.com/lwfinger/rtw89/issues/226#issuecomment-1520776761
> > Link: https://github.com/lwfinger/rtw89/issues/240
> > Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
> > ---
> > v2: add Fixes, Cc and Tested-by tags suggested by Larry.
> 
> Should this go to wireless tree for v6.4?
> 

Yes, please take it to v6.4. People can get stable connection with this fix.

Thank you
Ping-Ke
Kalle Valo April 26, 2023, 5:41 a.m. UTC | #3
Ping-Ke Shih <pkshih@realtek.com> writes:

>> -----Original Message-----
>> From: Kalle Valo <kvalo@kernel.org>
>> Sent: Wednesday, April 26, 2023 1:10 PM
>> To: Ping-Ke Shih <pkshih@realtek.com>
>> Cc: stable@vger.kernel.org; Larry.Finger@lwfinger.net;
>> linux-wireless@vger.kernel.org
>> Subject: Re: [PATCH v2] wifi: rtw89: 8852b: adjust quota to avoid
>> SER L1 caused by access null page
>> 
>> Ping-Ke Shih <pkshih@realtek.com> writes:
>> 
>> > Though SER can recover this case, traffic can get stuck for a while. Fix it
>> > by adjusting page quota to avoid hardware access null page of CMAC/DMAC.
>> >
>> > Fixes: a1cb097168fa ("wifi: rtw89: 8852b: configure DLE mem")
>> > Fixes: 3e870b481733 ("wifi: rtw89: 8852b: add HFC quota arrays")
>> > Cc: stable@vger.kernel.org
>> > Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
>> > Link: https://github.com/lwfinger/rtw89/issues/226#issuecomment-1520776761
>> > Link: https://github.com/lwfinger/rtw89/issues/240
>> > Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
>> > ---
>> > v2: add Fixes, Cc and Tested-by tags suggested by Larry.
>> 
>> Should this go to wireless tree for v6.4?
>
> Yes, please take it to v6.4. People can get stable connection with this fix.

Ok, I'll then take this to wireless.
Larry Finger April 26, 2023, 3:08 p.m. UTC | #4
On 4/26/23 00:16, Ping-Ke Shih wrote:
> 
> 
>> -----Original Message-----
>> From: Kalle Valo <kvalo@kernel.org>
>> Sent: Wednesday, April 26, 2023 1:10 PM
>> To: Ping-Ke Shih <pkshih@realtek.com>
>> Cc: stable@vger.kernel.org; Larry.Finger@lwfinger.net; linux-wireless@vger.kernel.org
>> Subject: Re: [PATCH v2] wifi: rtw89: 8852b: adjust quota to avoid SER L1 caused by access null page
>>
>> Ping-Ke Shih <pkshih@realtek.com> writes:
>>
>>> Though SER can recover this case, traffic can get stuck for a while. Fix it
>>> by adjusting page quota to avoid hardware access null page of CMAC/DMAC.
>>>
>>> Fixes: a1cb097168fa ("wifi: rtw89: 8852b: configure DLE mem")
>>> Fixes: 3e870b481733 ("wifi: rtw89: 8852b: add HFC quota arrays")
>>> Cc: stable@vger.kernel.org
>>> Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
>>> Link: https://github.com/lwfinger/rtw89/issues/226#issuecomment-1520776761
>>> Link: https://github.com/lwfinger/rtw89/issues/240
>>> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
>>> ---
>>> v2: add Fixes, Cc and Tested-by tags suggested by Larry.
>>
>> Should this go to wireless tree for v6.4?
>>
> 
> Yes, please take it to v6.4. People can get stable connection with this fix.

I agree.

Larry
Kalle Valo May 12, 2023, 8:22 a.m. UTC | #5
Ping-Ke Shih <pkshih@realtek.com> wrote:

> Though SER can recover this case, traffic can get stuck for a while. Fix it
> by adjusting page quota to avoid hardware access null page of CMAC/DMAC.
> 
> Fixes: a1cb097168fa ("wifi: rtw89: 8852b: configure DLE mem")
> Fixes: 3e870b481733 ("wifi: rtw89: 8852b: add HFC quota arrays")
> Cc: stable@vger.kernel.org
> Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
> Link: https://github.com/lwfinger/rtw89/issues/226#issuecomment-1520776761
> Link: https://github.com/lwfinger/rtw89/issues/240
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>

Patch applied to wireless.git, thanks.

c0426c446d92 wifi: rtw89: 8852b: adjust quota to avoid SER L1 caused by access null page
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
index b8019cfc11b20..512de491a064b 100644
--- a/drivers/net/wireless/realtek/rtw89/mac.c
+++ b/drivers/net/wireless/realtek/rtw89/mac.c
@@ -1425,6 +1425,8 @@  const struct rtw89_mac_size_set rtw89_mac_size = {
 	.wde_size4 = {RTW89_WDE_PG_64, 0, 4096,},
 	/* PCIE 64 */
 	.wde_size6 = {RTW89_WDE_PG_64, 512, 0,},
+	/* 8852B PCIE SCC */
+	.wde_size7 = {RTW89_WDE_PG_64, 510, 2,},
 	/* DLFW */
 	.wde_size9 = {RTW89_WDE_PG_64, 0, 1024,},
 	/* 8852C DLFW */
@@ -1449,6 +1451,8 @@  const struct rtw89_mac_size_set rtw89_mac_size = {
 	.wde_qt4 = {0, 0, 0, 0,},
 	/* PCIE 64 */
 	.wde_qt6 = {448, 48, 0, 16,},
+	/* 8852B PCIE SCC */
+	.wde_qt7 = {446, 48, 0, 16,},
 	/* 8852C DLFW */
 	.wde_qt17 = {0, 0, 0,  0,},
 	/* 8852C PCIE SCC */
diff --git a/drivers/net/wireless/realtek/rtw89/mac.h b/drivers/net/wireless/realtek/rtw89/mac.h
index a8d9847ef0b49..6ba633ccdd037 100644
--- a/drivers/net/wireless/realtek/rtw89/mac.h
+++ b/drivers/net/wireless/realtek/rtw89/mac.h
@@ -792,6 +792,7 @@  struct rtw89_mac_size_set {
 	const struct rtw89_dle_size wde_size0;
 	const struct rtw89_dle_size wde_size4;
 	const struct rtw89_dle_size wde_size6;
+	const struct rtw89_dle_size wde_size7;
 	const struct rtw89_dle_size wde_size9;
 	const struct rtw89_dle_size wde_size18;
 	const struct rtw89_dle_size wde_size19;
@@ -804,6 +805,7 @@  struct rtw89_mac_size_set {
 	const struct rtw89_wde_quota wde_qt0;
 	const struct rtw89_wde_quota wde_qt4;
 	const struct rtw89_wde_quota wde_qt6;
+	const struct rtw89_wde_quota wde_qt7;
 	const struct rtw89_wde_quota wde_qt17;
 	const struct rtw89_wde_quota wde_qt18;
 	const struct rtw89_ple_quota ple_qt4;
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852b.c b/drivers/net/wireless/realtek/rtw89/rtw8852b.c
index eaa2ea0586bc6..6da1b603a9a95 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8852b.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852b.c
@@ -18,25 +18,25 @@ 
 	RTW8852B_FW_BASENAME "-" __stringify(RTW8852B_FW_FORMAT_MAX) ".bin"
 
 static const struct rtw89_hfc_ch_cfg rtw8852b_hfc_chcfg_pcie[] = {
-	{5, 343, grp_0}, /* ACH 0 */
-	{5, 343, grp_0}, /* ACH 1 */
-	{5, 343, grp_0}, /* ACH 2 */
-	{5, 343, grp_0}, /* ACH 3 */
+	{5, 341, grp_0}, /* ACH 0 */
+	{5, 341, grp_0}, /* ACH 1 */
+	{4, 342, grp_0}, /* ACH 2 */
+	{4, 342, grp_0}, /* ACH 3 */
 	{0, 0, grp_0}, /* ACH 4 */
 	{0, 0, grp_0}, /* ACH 5 */
 	{0, 0, grp_0}, /* ACH 6 */
 	{0, 0, grp_0}, /* ACH 7 */
-	{4, 344, grp_0}, /* B0MGQ */
-	{4, 344, grp_0}, /* B0HIQ */
+	{4, 342, grp_0}, /* B0MGQ */
+	{4, 342, grp_0}, /* B0HIQ */
 	{0, 0, grp_0}, /* B1MGQ */
 	{0, 0, grp_0}, /* B1HIQ */
 	{40, 0, 0} /* FWCMDQ */
 };
 
 static const struct rtw89_hfc_pub_cfg rtw8852b_hfc_pubcfg_pcie = {
-	448, /* Group 0 */
+	446, /* Group 0 */
 	0, /* Group 1 */
-	448, /* Public Max */
+	446, /* Public Max */
 	0 /* WP threshold */
 };
 
@@ -49,13 +49,13 @@  static const struct rtw89_hfc_param_ini rtw8852b_hfc_param_ini_pcie[] = {
 };
 
 static const struct rtw89_dle_mem rtw8852b_dle_mem_pcie[] = {
-	[RTW89_QTA_SCC] = {RTW89_QTA_SCC, &rtw89_mac_size.wde_size6,
-			   &rtw89_mac_size.ple_size6, &rtw89_mac_size.wde_qt6,
-			   &rtw89_mac_size.wde_qt6, &rtw89_mac_size.ple_qt18,
+	[RTW89_QTA_SCC] = {RTW89_QTA_SCC, &rtw89_mac_size.wde_size7,
+			   &rtw89_mac_size.ple_size6, &rtw89_mac_size.wde_qt7,
+			   &rtw89_mac_size.wde_qt7, &rtw89_mac_size.ple_qt18,
 			   &rtw89_mac_size.ple_qt58},
-	[RTW89_QTA_WOW] = {RTW89_QTA_WOW, &rtw89_mac_size.wde_size6,
-			   &rtw89_mac_size.ple_size6, &rtw89_mac_size.wde_qt6,
-			   &rtw89_mac_size.wde_qt6, &rtw89_mac_size.ple_qt18,
+	[RTW89_QTA_WOW] = {RTW89_QTA_WOW, &rtw89_mac_size.wde_size7,
+			   &rtw89_mac_size.ple_size6, &rtw89_mac_size.wde_qt7,
+			   &rtw89_mac_size.wde_qt7, &rtw89_mac_size.ple_qt18,
 			   &rtw89_mac_size.ple_qt_52b_wow},
 	[RTW89_QTA_DLFW] = {RTW89_QTA_DLFW, &rtw89_mac_size.wde_size9,
 			    &rtw89_mac_size.ple_size8, &rtw89_mac_size.wde_qt4,