All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Bitterblue Smith <rtl8821cerfe2@gmail.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: RE: [PATCH rtw-next v2 10/14] wifi: rtw89: Fix rtw89_mac_power_switch() for USB
Date: Mon, 16 Jun 2025 02:21:12 +0000	[thread overview]
Message-ID: <efd3cb5f165748d6ba8429024ce2b03a@realtek.com> (raw)
In-Reply-To: <1faf699e-b40c-4408-8655-b5bc8a6776e1@gmail.com>

Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> Clear some bits in some registers in order to allow RTL8851BU to power
> on.

As your description, it should be called when going to power on, but called
by both power on/off. 

However vendor driver did the same as yours. I'd keep it as was. Please
mention this behavior is from vendor driver in commit message. 

> Also tested with RTL8832BU and RTL8832CU.
> 
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> ---
> v2:
>  - Put the new code in a function.
> ---
>  drivers/net/wireless/realtek/rtw89/mac.c | 20 ++++++++++++++++++++
>  drivers/net/wireless/realtek/rtw89/reg.h |  1 +
>  2 files changed, 21 insertions(+)
> 
> diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
> index 875c1a3c5ca8..bccb504915f4 100644
> --- a/drivers/net/wireless/realtek/rtw89/mac.c
> +++ b/drivers/net/wireless/realtek/rtw89/mac.c
> @@ -1449,6 +1449,24 @@ void rtw89_mac_notify_wake(struct rtw89_dev *rtwdev)
>         rtw89_mac_send_rpwm(rtwdev, state, true);
>  }
> 
> +static void rtw89_mac_power_switch_boot_mode(struct rtw89_dev *rtwdev)
> +{
> +       u32 boot_mode;
> +
> +       if (rtwdev->hci.type != RTW89_HCI_TYPE_USB)

I checked internal log that initiator of this change is for USB devices, but
not check the HCI type though. 

> +               return;
> +
> +       boot_mode = rtw89_read32_mask(rtwdev, R_AX_GPIO_MUXCFG, B_AX_BOOT_MODE);
> +

No empty line between assignment and immediate checking. 

> +       if (!boot_mode)
> +               return;
> +
> +       rtw89_write32_clr(rtwdev, R_AX_SYS_PW_CTRL, B_AX_APFN_ONMAC);
> +       rtw89_write32_clr(rtwdev, R_AX_SYS_STATUS1, B_AX_AUTO_WLPON);
> +       rtw89_write32_clr(rtwdev, R_AX_GPIO_MUXCFG, B_AX_BOOT_MODE);
> +       rtw89_write32_clr(rtwdev, R_AX_RSV_CTRL, B_AX_R_DIS_PRST);
> +}
> +



  reply	other threads:[~2025-06-16  2:21 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-09 19:22 [PATCH rtw-next v2 00/14] wifi: rtw89: Add support for USB devices Bitterblue Smith
2025-06-09 19:23 ` [PATCH rtw-next v2 01/14] wifi: rtw89: 8851b: Accept USB devices and load their MAC address Bitterblue Smith
2025-06-09 19:24 ` [PATCH rtw-next v2 02/14] wifi: rtw89: Make dle_mem in rtw89_chip_info an array Bitterblue Smith
2025-06-16  1:15   ` Ping-Ke Shih
2025-06-09 19:25 ` [PATCH rtw-next v2 03/14] wifi: rtw89: Make hfc_param_ini " Bitterblue Smith
2025-06-16  1:26   ` Ping-Ke Shih
2025-06-16 16:55     ` Bitterblue Smith
2025-06-17  0:19       ` Ping-Ke Shih
2025-06-09 19:26 ` [PATCH rtw-next v2 04/14] wifi: rtw89: Add rtw8851b_dle_mem_usb{2,3} Bitterblue Smith
2025-06-16  1:28   ` Ping-Ke Shih
2025-06-09 19:27 ` [PATCH rtw-next v2 05/14] wifi: rtw89: Add rtw8851b_hfc_param_ini_usb Bitterblue Smith
2025-06-16  1:32   ` Ping-Ke Shih
2025-06-09 19:28 ` [PATCH rtw-next v2 06/14] wifi: rtw89: Disable deep power saving for USB/SDIO Bitterblue Smith
2025-06-16  1:42   ` Ping-Ke Shih
2025-06-18 11:05     ` Bitterblue Smith
2025-06-09 19:28 ` [PATCH rtw-next v2 07/14] wifi: rtw89: Add extra TX headroom for USB Bitterblue Smith
2025-06-09 19:29 ` [PATCH rtw-next v2 08/14] wifi: rtw89: Hide some errors when the device is unplugged Bitterblue Smith
2025-06-09 19:30 ` [PATCH rtw-next v2 09/14] wifi: rtw89: 8851b: Modify rtw8851b_pwr_{on,off}_func() for USB Bitterblue Smith
2025-06-10 14:11   ` kernel test robot
2025-06-16  1:51   ` Ping-Ke Shih
2025-06-18 13:53     ` Bitterblue Smith
2025-06-09 19:30 ` [PATCH rtw-next v2 10/14] wifi: rtw89: Fix rtw89_mac_power_switch() " Bitterblue Smith
2025-06-16  2:21   ` Ping-Ke Shih [this message]
2025-06-16  9:14   ` Ping-Ke Shih
2025-06-09 19:31 ` [PATCH rtw-next v2 11/14] wifi: rtw89: Add some definitions " Bitterblue Smith
2025-06-09 19:32 ` [PATCH rtw-next v2 12/14] wifi: rtw89: Add usb.{c,h} Bitterblue Smith
2025-06-16  3:10   ` Ping-Ke Shih
2025-06-18 11:06     ` Bitterblue Smith
2025-06-09 19:33 ` [PATCH rtw-next v2 13/14] wifi: rtw89: Add rtw8851bu.c Bitterblue Smith
2025-06-16  3:11   ` Ping-Ke Shih
2025-06-09 19:34 ` [PATCH rtw-next v2 14/14] wifi: rtw89: Enable the new USB modules Bitterblue Smith
2025-06-10 11:55   ` kernel test robot
2025-06-10 13:33     ` Bitterblue Smith
2025-06-11  0:32       ` Ping-Ke Shih
2025-06-11  0:33         ` Ping-Ke Shih
2025-06-11 12:37         ` Bitterblue Smith
2025-06-12  1:27           ` Ping-Ke Shih
2025-06-16  3:15             ` 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=efd3cb5f165748d6ba8429024ce2b03a@realtek.com \
    --to=pkshih@realtek.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rtl8821cerfe2@gmail.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.