diff mbox series

[rtw-next,1/2] wifi: rtw88: Fix RX aggregation settings for RTL8723DS

Message ID 24dacc36-cfc2-475a-8bc5-aad04cd97aa3@gmail.com
State Superseded
Headers show
Series [rtw-next,1/2] wifi: rtw88: Fix RX aggregation settings for RTL8723DS | expand

Commit Message

Bitterblue Smith April 28, 2025, 9:26 p.m. UTC
Use the same RX aggregation size and timeout used by the out-of-tree
RTL8723DS driver. Also set mystery bit 31 of REG_RXDMA_AGG_PG_TH. This
improves the RX speed from ~44 Mbps to ~67 Mbps.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
 drivers/net/wireless/realtek/rtw88/sdio.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Ping-Ke Shih April 29, 2025, 1:03 a.m. UTC | #1
Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> Use the same RX aggregation size and timeout used by the out-of-tree
> RTL8723DS driver. Also set mystery bit 31 of REG_RXDMA_AGG_PG_TH. This
> improves the RX speed from ~44 Mbps to ~67 Mbps.
> 
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> ---
>  drivers/net/wireless/realtek/rtw88/sdio.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/sdio.c b/drivers/net/wireless/realtek/rtw88/sdio.c
> index c57f683d9af8..6f63fd5db665 100644
> --- a/drivers/net/wireless/realtek/rtw88/sdio.c
> +++ b/drivers/net/wireless/realtek/rtw88/sdio.c
> @@ -677,12 +677,20 @@ static void rtw_sdio_enable_rx_aggregation(struct rtw_dev *rtwdev)
>  {
>         u8 size, timeout;
> 
> -       if (rtw_chip_wcpu_11n(rtwdev)) {

Originally this only affects 11n chips, but now it affects all chips by
default case. Is that in your expectation? 

And have you tested chips other than RTL8723DS you mentioned in commit
message. If so, please add them to commit message. 

> +       switch (rtwdev->chip->id) {
> +       case RTW_CHIP_TYPE_8703B:
>                 size = 0x6;
>                 timeout = 0x6;
> -       } else {
> +               break;
> +       case RTW_CHIP_TYPE_8723D:
> +               size = 0xa;
> +               timeout = 0x3;
> +               rtw_write8_set(rtwdev, REG_RXDMA_AGG_PG_TH + 3, BIT(7));
> +               break;
> +       default:
>                 size = 0xff;
>                 timeout = 0x1;
> +               break;
>         }
> 
>         /* Make the firmware honor the size limit configured below */
> --
> 2.49.0
Ping-Ke Shih April 29, 2025, 1:09 a.m. UTC | #2
Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> Some users have RTL8723DS chips with nearly blank efuse. Currently these
> chips cannot connect when using rtw88, but they do work using the old
> out-of-tree driver.
> 
> Use reasonable default values for TX power, antenna configuration, and
> crystal cap if the chip's efuse is missing these things.
> 
> RTL8723D can use the same default values as RTL8703B, so simply move
> the code from rtl8703b_read_efuse() to the shared function
> __rtl8723x_read_efuse().
> 
> Link: https://github.com/lwfinger/rtw88/issues/157
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>

Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Bitterblue Smith April 29, 2025, 11:38 a.m. UTC | #3
On 29/04/2025 04:03, Ping-Ke Shih wrote:
> Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
>> Use the same RX aggregation size and timeout used by the out-of-tree
>> RTL8723DS driver. Also set mystery bit 31 of REG_RXDMA_AGG_PG_TH. This
>> improves the RX speed from ~44 Mbps to ~67 Mbps.
>>
>> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
>> ---
>>  drivers/net/wireless/realtek/rtw88/sdio.c | 12 ++++++++++--
>>  1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/wireless/realtek/rtw88/sdio.c b/drivers/net/wireless/realtek/rtw88/sdio.c
>> index c57f683d9af8..6f63fd5db665 100644
>> --- a/drivers/net/wireless/realtek/rtw88/sdio.c
>> +++ b/drivers/net/wireless/realtek/rtw88/sdio.c
>> @@ -677,12 +677,20 @@ static void rtw_sdio_enable_rx_aggregation(struct rtw_dev *rtwdev)
>>  {
>>         u8 size, timeout;
>>
>> -       if (rtw_chip_wcpu_11n(rtwdev)) {
> 
> Originally this only affects 11n chips, but now it affects all chips by
> default case. Is that in your expectation? 
> 

I think it only changes the behaviour for RTL8723D, RTL8821A, and
RTL8812A. These last two don't have SDIO drivers in rtw88, but I can
add them to the switch so they get the same size and timeout as
before.

> And have you tested chips other than RTL8723DS you mentioned in commit
> message. If so, please add them to commit message. 
> 

I only tested RTL8723DS. I don't have others.

>> +       switch (rtwdev->chip->id) {
>> +       case RTW_CHIP_TYPE_8703B:
>>                 size = 0x6;
>>                 timeout = 0x6;
>> -       } else {
>> +               break;
>> +       case RTW_CHIP_TYPE_8723D:
>> +               size = 0xa;
>> +               timeout = 0x3;
>> +               rtw_write8_set(rtwdev, REG_RXDMA_AGG_PG_TH + 3, BIT(7));
>> +               break;
>> +       default:
>>                 size = 0xff;
>>                 timeout = 0x1;
>> +               break;
>>         }
>>
>>         /* Make the firmware honor the size limit configured below */
>> --
>> 2.49.0
>
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw88/sdio.c b/drivers/net/wireless/realtek/rtw88/sdio.c
index c57f683d9af8..6f63fd5db665 100644
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
@@ -677,12 +677,20 @@  static void rtw_sdio_enable_rx_aggregation(struct rtw_dev *rtwdev)
 {
 	u8 size, timeout;
 
-	if (rtw_chip_wcpu_11n(rtwdev)) {
+	switch (rtwdev->chip->id) {
+	case RTW_CHIP_TYPE_8703B:
 		size = 0x6;
 		timeout = 0x6;
-	} else {
+		break;
+	case RTW_CHIP_TYPE_8723D:
+		size = 0xa;
+		timeout = 0x3;
+		rtw_write8_set(rtwdev, REG_RXDMA_AGG_PG_TH + 3, BIT(7));
+		break;
+	default:
 		size = 0xff;
 		timeout = 0x1;
+		break;
 	}
 
 	/* Make the firmware honor the size limit configured below */