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 v1 06/13] wifi: rtw89: Disable some power saving for USB
Date: Mon, 26 May 2025 00:57:21 +0300 [thread overview]
Message-ID: <2ce556de-7ccb-4c6e-be09-da1d3e8d8274@gmail.com> (raw)
In-Reply-To: <8350f850345248b4bcef32204c944168@realtek.com>
On 13/05/2025 06:27, Ping-Ke Shih wrote:
> Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
>> Disable rtw89_ps_power_mode_change() and rtw89_mac_send_rpwm() for
>> USB because they are called in atomic context and accessing hardware
>> registers results in "scheduling while atomic" errors.
>
> I feel rtw89_ps_power_mode_change() should be not in atomic context.
> Please check this.
>
I think you're right, only rtw89_mac_send_rpwm() is called in atomic
context. rtw89_ps_power_mode_change() is disabled for other reasons:
1) It calls rtw89_mac_power_mode_change(), which prints errors when
rtw89_mac_send_rpwm() is disabled.
2) With RTL8852CU it calls rtw89_ps_power_mode_change_with_hci()
which calls napi_schedule(). That results in dereferencing a null
pointer.
>>
>> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
>> ---
>> drivers/net/wireless/realtek/rtw89/mac.c | 3 +++
>> drivers/net/wireless/realtek/rtw89/ps.c | 3 +++
>> 2 files changed, 6 insertions(+)
>>
>> diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
>> index a316864ad137..1a03355b340f 100644
>> --- a/drivers/net/wireless/realtek/rtw89/mac.c
>> +++ b/drivers/net/wireless/realtek/rtw89/mac.c
>> @@ -1338,6 +1338,9 @@ static void rtw89_mac_send_rpwm(struct rtw89_dev *rtwdev,
>> {
>> u16 request;
>>
>> + if (rtwdev->hci.type == RTW89_HCI_TYPE_USB)
>
> I think SDIO devices have the same problems as USB, so I prefer to return
> if "!= PCIE".
>
>> + return;
>> +
>> spin_lock_bh(&rtwdev->rpwm_lock);
>>
>> request = rtw89_read16(rtwdev, R_AX_RPWM);
>> diff --git a/drivers/net/wireless/realtek/rtw89/ps.c b/drivers/net/wireless/realtek/rtw89/ps.c
>> index ac46a7baa00d..edff9f8e1016 100644
>> --- a/drivers/net/wireless/realtek/rtw89/ps.c
>> +++ b/drivers/net/wireless/realtek/rtw89/ps.c
>> @@ -56,6 +56,9 @@ static void rtw89_ps_power_mode_change_with_hci(struct rtw89_dev *rtwdev,
>>
>> static void rtw89_ps_power_mode_change(struct rtw89_dev *rtwdev, bool enter)
>> {
>> + if (rtwdev->hci.type == RTW89_HCI_TYPE_USB)
>> + return;
>> +
>> if (rtwdev->chip->low_power_hci_modes & BIT(rtwdev->ps_mode) &&
>> !test_bit(RTW89_FLAG_WOWLAN, rtwdev->flags))
>> rtw89_ps_power_mode_change_with_hci(rtwdev, enter);
>> --
>> 2.49.0
>
next prev parent reply other threads:[~2025-05-25 21:57 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-04 20:47 [PATCH rtw-next v1 00/13] wifi: rtw89: Add support for USB devices Bitterblue Smith
2025-05-04 20:49 ` [PATCH rtw-next v1 01/13] wifi: rtw89: 8851b: Accept USB devices and load their MAC address Bitterblue Smith
2025-05-13 2:46 ` Ping-Ke Shih
2025-05-04 20:49 ` [PATCH rtw-next v1 02/13] wifi: rtw89: Get dle_mem via rtw89_hci_dle_mem() Bitterblue Smith
2025-05-13 2:51 ` Ping-Ke Shih
2025-05-14 0:56 ` Ping-Ke Shih
2025-05-25 22:04 ` Bitterblue Smith
2025-05-26 2:52 ` Ping-Ke Shih
2025-05-04 20:49 ` [PATCH rtw-next v1 03/13] wifi: rtw89: Rename hfc_param_ini to hfc_param_ini_pcie Bitterblue Smith
2025-05-13 3:04 ` Ping-Ke Shih
2025-05-04 20:50 ` [PATCH rtw-next v1 04/13] wifi: rtw89: Add dle_mem_usb2 and dle_mem_usb3 Bitterblue Smith
2025-05-13 3:06 ` Ping-Ke Shih
2025-05-04 20:51 ` [PATCH rtw-next v1 05/13] wifi: rtw89: Add hfc_param_ini_usb Bitterblue Smith
2025-05-13 3:12 ` Ping-Ke Shih
2025-05-25 21:55 ` Bitterblue Smith
2025-05-26 1:51 ` Ping-Ke Shih
2025-05-26 6:29 ` Ping-Ke Shih
2025-05-31 20:57 ` Bitterblue Smith
2025-05-31 20:54 ` Bitterblue Smith
2025-05-04 20:51 ` [PATCH rtw-next v1 06/13] wifi: rtw89: Disable some power saving for USB Bitterblue Smith
2025-05-13 3:27 ` Ping-Ke Shih
2025-05-25 21:57 ` Bitterblue Smith [this message]
2025-05-26 2:36 ` Ping-Ke Shih
2025-05-04 20:51 ` [PATCH rtw-next v1 07/13] wifi: rtw89: Add extra TX headroom " Bitterblue Smith
2025-05-13 3:28 ` Ping-Ke Shih
2025-05-04 20:52 ` [PATCH rtw-next v1 08/13] wifi: rtw89: Hide some errors when the device is unplugged Bitterblue Smith
2025-05-13 3:43 ` Ping-Ke Shih
2025-05-25 21:58 ` Bitterblue Smith
2025-05-04 20:52 ` [PATCH rtw-next v1 09/13] wifi: rtw89: Fix rtw89_mac_power_switch() for USB Bitterblue Smith
2025-05-13 3:50 ` Ping-Ke Shih
2025-05-25 21:58 ` Bitterblue Smith
2025-05-26 2:45 ` Ping-Ke Shih
2025-05-04 20:53 ` [PATCH rtw-next v1 10/13] wifi: rtw89: Add some definitions " Bitterblue Smith
2025-05-13 3:52 ` Ping-Ke Shih
2025-05-04 20:54 ` [PATCH rtw-next v1 11/13] wifi: rtw89: Add usb.{c,h} Bitterblue Smith
2025-05-13 6:12 ` Ping-Ke Shih
2025-05-25 22:03 ` Bitterblue Smith
2025-05-26 3:18 ` Ping-Ke Shih
2025-05-31 21:03 ` Bitterblue Smith
2025-05-04 20:54 ` [PATCH rtw-next v1 12/13] wifi: rtw89: Add rtw8851bu.c Bitterblue Smith
2025-05-13 6:14 ` Ping-Ke Shih
2025-05-04 20:55 ` [PATCH rtw-next v1 13/13] wifi: rtw89: Enable the new USB modules Bitterblue Smith
2025-05-13 6:14 ` Ping-Ke Shih
2025-05-13 6:22 ` [PATCH rtw-next v1 00/13] wifi: rtw89: Add support for USB devices Ping-Ke Shih
2025-05-13 7:07 ` Ping-Ke Shih
2025-05-25 22:03 ` Bitterblue Smith
2025-05-26 1:35 ` 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=2ce556de-7ccb-4c6e-be09-da1d3e8d8274@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.