From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
To: Ping-Ke Shih <pkshih@realtek.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH rtw-next 2/2] wifi: rtw88: usb: Upload the firmware in bigger chunks
Date: Thu, 8 May 2025 19:58:53 +0300 [thread overview]
Message-ID: <0890b8b7-0426-404e-b833-0144b726e17e@gmail.com> (raw)
In-Reply-To: <670259643afc42f581632c7383fa7f3f@realtek.com>
On 08/05/2025 06:29, Ping-Ke Shih wrote:
> : Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
>> RTL8811AU stops responding during the firmware download on some systems:
>>
>> [ 809.256440] rtw_8821au 5-2.1:1.0: Firmware version 42.4.0, H2C version 0
>> [ 812.759142] rtw_8821au 5-2.1:1.0 wlp48s0f4u2u1: renamed from wlan0
>> [ 837.315388] rtw_8821au 1-4:1.0: write register 0x1ef4 failed with -110
>> [ 867.524259] rtw_8821au 1-4:1.0: write register 0x1ef8 failed with -110
>> [ 868.930976] rtw_8821au 5-2.1:1.0 wlp48s0f4u2u1: entered promiscuous mode
>> [ 897.730952] rtw_8821au 1-4:1.0: write register 0x1efc failed with -110
>>
>> Maybe it takes too long when writing the firmware 4 bytes at a time.
>>
>> Write 196 bytes at a time for RTL8821AU, RTL8811AU, and RTL8812AU,
>> and 254 bytes at a time for RTL8723DU. These are the sizes used in
>> their official drivers. Tested with all these chips.
>>
>> Cc: stable@vger.kernel.org
>> Link: https://github.com/lwfinger/rtw88/issues/344
>> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>
>
> [..]
>
>> diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c
>> index b16db579fdce..ad15ce12ab7f 100644
>> --- a/drivers/net/wireless/realtek/rtw88/usb.c
>> +++ b/drivers/net/wireless/realtek/rtw88/usb.c
>> @@ -165,6 +165,60 @@ static void rtw_usb_write32(struct rtw_dev *rtwdev, u32 addr, u32 val)
>> rtw_usb_write(rtwdev, addr, val, 4);
>> }
>>
>> +static void rtw_usb_write_firmware_page(struct rtw_dev *rtwdev, u32 page,
>> + const u8 *data, u32 size)
>> +{
>> + struct rtw_usb *rtwusb = rtw_get_usb_priv(rtwdev);
>> + struct usb_device *udev = rtwusb->udev;
>> + u32 addr = FW_8192C_START_ADDRESS;
>
> FW_8192C_START_ADDRESS is existing already. But something like
> RTW_USB_FW_START_ADDRESS would be better.
>
I agree, because rtw88 doesn't handle RTL8192C. There is
FW_START_ADDR_LEGACY in fw.h. I must not have noticed it before.
Should I send v2 for this?
>> + u8 *data_dup, *buf;
>> + u32 n, block_size;
>> + int ret;
>> +
>> + switch (rtwdev->chip->id) {
>> + case RTW_CHIP_TYPE_8723D:
>> + block_size = 254;
>> + break;
>> + default:
>> + block_size = 196;
>> + break;
>> + }
>> +
>> + data_dup = kmemdup(data, size, GFP_KERNEL);
>
> This is because type of argument `data` of usb_control_msg() is not const, right?
> Do you know if usb_control_msg() will actually modify the data?
>
No, it's because usb_control_msg() rejects memory allocated by
vmalloc(). I don't remember what error it printed. Maybe because the
memory is not suitable for DMA.
next prev parent reply other threads:[~2025-05-08 16:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-07 13:03 [PATCH rtw-next 1/2] wifi: rtw88: usb: Reduce control message timeout to 500 ms Bitterblue Smith
2025-05-07 13:05 ` [PATCH rtw-next 2/2] wifi: rtw88: usb: Upload the firmware in bigger chunks Bitterblue Smith
2025-05-08 3:29 ` Ping-Ke Shih
2025-05-08 16:58 ` Bitterblue Smith [this message]
2025-05-09 0:43 ` Ping-Ke Shih
2025-05-10 11:51 ` Bitterblue Smith
2025-05-08 3:11 ` [PATCH rtw-next 1/2] wifi: rtw88: usb: Reduce control message timeout to 500 ms Ping-Ke Shih
2025-05-08 16:41 ` Bitterblue Smith
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=0890b8b7-0426-404e-b833-0144b726e17e@gmail.com \
--to=rtl8821cerfe2@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--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