mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH rtw-next] wifi: rtw88: 8821c: disable deep LPS on PCIe devices
       [not found] <20260918232801.119348-1-eexto.ref@aol.com>
@ 2026-09-18 23:28 ` Paolo Lazzaroni
  2026-09-19 17:39   ` Bitterblue Smith
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Lazzaroni @ 2026-09-18 23:28 UTC (permalink / raw)
  To: Ping-Ke Shih, Kalle Valo, linux-wireless, linux-kernel
  Cc: Oleksandr Havrylov, Gabriel Maia, Rahul Kumar Rai,
	Mihail Dimoski, Ata İlhan Köktürk,
	Bitterblue Smith, Paolo Lazzaroni

On RTL8821CE PCIe adapters, entering 32kHz low-power clock deep sleep
(LPS_DEEP_MODE_LCLK) causes recurrent PCIe completion timeouts,
"firmware failed to leave lps state", "failed to send h2c command",
and hard system freezes when transitioning out of low power states with
PCIe ASPM enabled.

To work around this, a DMI quirk list (rtw_pci_quirks[]) was introduced
and has grown across HP, ASUS, Dell, and Lenovo machines. However, DMI
matching is unsustainable: minor sub-model variances (such as ASUS
FA506II vs FA506IH) or unlisted models (such as ASUS VivoBook X515JA,
Bmax Y14, or modern Alder Lake-N mini PCs) leave users experiencing bus
lockups or firmware drops unless they manually turn off power saving via
iw.

Examination of official OEM Windows driver INF files for RTL8821CE
(HP and ASUS netrtwlane.inf) reveals that vendor drivers explicitly
disable deep power saving (WoWLANPSMode = 0, bLPS_PG_En = 0) and enable
firmware PCIe recovery, while keeping standard PCIe ASPM enabled.
Furthermore, other chips in rtw88 (RTL8723DE, RTL8812AE, RTL8821AE)
already set lps_deep_mode_supported = 0 by default.

Conservatively disable LPS_DEEP_MODE_LCLK specifically for RTL8821C on
PCIe interfaces in rtw_update_lps_deep_mode(). Standard 802.11 LPS
power saving and PCIe ASPM remain functional, preventing system lockups
and firmware failures without affecting SDIO or USB variants.

Signed-off-by: Paolo Lazzaroni <eexto@aol.com>
---
 drivers/net/wireless/realtek/rtw88/main.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index 0f23498b5..5bd854223 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -1360,6 +1360,14 @@ static enum rtw_lps_deep_mode rtw_update_lps_deep_mode(struct rtw_dev *rtwdev,
 	    !fw->feature)
 		return LPS_DEEP_MODE_NONE;
 
+	/* RTL8821CE PCIe devices fail to wake up from 32kHz LCLK deep sleep
+	 * in time for PCIe completion deadlines, leading to PCIe bus freeze
+	 * and communication timeouts.
+	 */
+	if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_PCIE &&
+	    chip->id == RTW_CHIP_TYPE_8821C)
+		return LPS_DEEP_MODE_NONE;
+
 	if ((chip->lps_deep_mode_supported & BIT(LPS_DEEP_MODE_PG)) &&
 	    rtw_fw_feature_check(fw, FW_FEATURE_PG))
 		return LPS_DEEP_MODE_PG;
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH rtw-next] wifi: rtw88: 8821c: disable deep LPS on PCIe devices
  2026-09-18 23:28 ` [PATCH rtw-next] wifi: rtw88: 8821c: disable deep LPS on PCIe devices Paolo Lazzaroni
@ 2026-09-19 17:39   ` Bitterblue Smith
  2026-09-20  2:36     ` Ping-Ke Shih
  0 siblings, 1 reply; 3+ messages in thread
From: Bitterblue Smith @ 2026-09-19 17:39 UTC (permalink / raw)
  To: Paolo Lazzaroni, Ping-Ke Shih, Kalle Valo, linux-wireless, linux-kernel
  Cc: Oleksandr Havrylov, Gabriel Maia, Rahul Kumar Rai,
	Mihail Dimoski, Ata İlhan Köktürk

On 19/09/2026 02:28, Paolo Lazzaroni wrote:
> On RTL8821CE PCIe adapters, entering 32kHz low-power clock deep sleep
> (LPS_DEEP_MODE_LCLK) causes recurrent PCIe completion timeouts,
> "firmware failed to leave lps state", "failed to send h2c command",
> and hard system freezes when transitioning out of low power states with
> PCIe ASPM enabled.
> 
> To work around this, a DMI quirk list (rtw_pci_quirks[]) was introduced
> and has grown across HP, ASUS, Dell, and Lenovo machines. However, DMI
> matching is unsustainable: minor sub-model variances (such as ASUS
> FA506II vs FA506IH) or unlisted models (such as ASUS VivoBook X515JA,
> Bmax Y14, or modern Alder Lake-N mini PCs) leave users experiencing bus
> lockups or firmware drops unless they manually turn off power saving via
> iw.
> 
> Examination of official OEM Windows driver INF files for RTL8821CE
> (HP and ASUS netrtwlane.inf) reveals that vendor drivers explicitly
> disable deep power saving (WoWLANPSMode = 0, bLPS_PG_En = 0) and enable

Disabling LPS_PG doesn't mean disabling LCLK, I think.

> firmware PCIe recovery, while keeping standard PCIe ASPM enabled.
> Furthermore, other chips in rtw88 (RTL8723DE, RTL8812AE, RTL8821AE)
> already set lps_deep_mode_supported = 0 by default.

What those other chips are doing is not relevant. RTL8812AE and
RTL8821AE are not officially supported in rtw88. (Not yet?)
lps_deep_mode_supported is zero in rtw8812a.c and rtw8821a.c because
rtw88_usb doesn't implement deep PS and I didn't research which
modes they could support if deep PS was implemented for USB.

> 
> Conservatively disable LPS_DEEP_MODE_LCLK specifically for RTL8821C on
> PCIe interfaces in rtw_update_lps_deep_mode(). Standard 802.11 LPS
> power saving and PCIe ASPM remain functional, preventing system lockups
> and firmware failures without affecting SDIO or USB variants.
> 
> Signed-off-by: Paolo Lazzaroni <eexto@aol.com>
> ---
>  drivers/net/wireless/realtek/rtw88/main.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
> index 0f23498b5..5bd854223 100644
> --- a/drivers/net/wireless/realtek/rtw88/main.c
> +++ b/drivers/net/wireless/realtek/rtw88/main.c
> @@ -1360,6 +1360,14 @@ static enum rtw_lps_deep_mode rtw_update_lps_deep_mode(struct rtw_dev *rtwdev,
>  	    !fw->feature)
>  		return LPS_DEEP_MODE_NONE;
>  
> +	/* RTL8821CE PCIe devices fail to wake up from 32kHz LCLK deep sleep
> +	 * in time for PCIe completion deadlines, leading to PCIe bus freeze

Completion timeout is already disabled for this chip.

> +	 * and communication timeouts.
> +	 */
> +	if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_PCIE &&
> +	    chip->id == RTW_CHIP_TYPE_8821C)
> +		return LPS_DEEP_MODE_NONE;
> +
>  	if ((chip->lps_deep_mode_supported & BIT(LPS_DEEP_MODE_PG)) &&
>  	    rtw_fw_feature_check(fw, FW_FEATURE_PG))
>  		return LPS_DEEP_MODE_PG;

However, I'm not saying it's necessarily wrong to disable deep PS for
this chip completely. I'm just objecting to your LLM's conclusions.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH rtw-next] wifi: rtw88: 8821c: disable deep LPS on PCIe devices
  2026-09-19 17:39   ` Bitterblue Smith
@ 2026-09-20  2:36     ` Ping-Ke Shih
  0 siblings, 0 replies; 3+ messages in thread
From: Ping-Ke Shih @ 2026-09-20  2:36 UTC (permalink / raw)
  To: Bitterblue Smith, Paolo Lazzaroni, Kalle Valo, linux-wireless,
	linux-kernel
  Cc: Oleksandr Havrylov, Gabriel Maia, Rahul Kumar Rai,
	Mihail Dimoski, Ata İlhan Köktürk


Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> On 19/09/2026 02:28, Paolo Lazzaroni wrote:
> > On RTL8821CE PCIe adapters, entering 32kHz low-power clock deep sleep
> > (LPS_DEEP_MODE_LCLK) causes recurrent PCIe completion timeouts,
> > "firmware failed to leave lps state", "failed to send h2c command",
> > and hard system freezes when transitioning out of low power states with
> > PCIe ASPM enabled.
> >
> > To work around this, a DMI quirk list (rtw_pci_quirks[]) was introduced
> > and has grown across HP, ASUS, Dell, and Lenovo machines. However, DMI
> > matching is unsustainable: minor sub-model variances (such as ASUS
> > FA506II vs FA506IH) or unlisted models (such as ASUS VivoBook X515JA,
> > Bmax Y14, or modern Alder Lake-N mini PCs) leave users experiencing bus
> > lockups or firmware drops unless they manually turn off power saving via
> > iw.
> >
> > Examination of official OEM Windows driver INF files for RTL8821CE
> > (HP and ASUS netrtwlane.inf) reveals that vendor drivers explicitly
> > disable deep power saving (WoWLANPSMode = 0, bLPS_PG_En = 0) and enable
> 
> Disabling LPS_PG doesn't mean disabling LCLK, I think.

Indeed. bLPS_PG_En should be LPS_DEEP_MODE_PG which 8821c's
.lps_deep_mode_supported doesn't declare this. 

> 
> > firmware PCIe recovery, while keeping standard PCIe ASPM enabled.
> > Furthermore, other chips in rtw88 (RTL8723DE, RTL8812AE, RTL8821AE)
> > already set lps_deep_mode_supported = 0 by default.
> 
> What those other chips are doing is not relevant. RTL8812AE and
> RTL8821AE are not officially supported in rtw88. (Not yet?)
> lps_deep_mode_supported is zero in rtw8812a.c and rtw8821a.c because
> rtw88_usb doesn't implement deep PS and I didn't research which
> modes they could support if deep PS was implemented for USB.
> 
> >
> > Conservatively disable LPS_DEEP_MODE_LCLK specifically for RTL8821C on
> > PCIe interfaces in rtw_update_lps_deep_mode(). Standard 802.11 LPS
> > power saving and PCIe ASPM remain functional, preventing system lockups
> > and firmware failures without affecting SDIO or USB variants.
> >
> > Signed-off-by: Paolo Lazzaroni <eexto@aol.com>
> > ---
> >  drivers/net/wireless/realtek/rtw88/main.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
> > index 0f23498b5..5bd854223 100644
> > --- a/drivers/net/wireless/realtek/rtw88/main.c
> > +++ b/drivers/net/wireless/realtek/rtw88/main.c
> > @@ -1360,6 +1360,14 @@ static enum rtw_lps_deep_mode rtw_update_lps_deep_mode(struct rtw_dev *rtwdev,
> >           !fw->feature)
> >               return LPS_DEEP_MODE_NONE;
> >
> > +     /* RTL8821CE PCIe devices fail to wake up from 32kHz LCLK deep sleep

First line of block comment should be empty.

> > +      * in time for PCIe completion deadlines, leading to PCIe bus freeze
> 
> Completion timeout is already disabled for this chip.
> 
> > +      * and communication timeouts.
> > +      */
> > +     if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_PCIE &&
> > +         chip->id == RTW_CHIP_TYPE_8821C)
> > +             return LPS_DEEP_MODE_NONE;
> > +
> >       if ((chip->lps_deep_mode_supported & BIT(LPS_DEEP_MODE_PG)) &&
> >           rtw_fw_feature_check(fw, FW_FEATURE_PG))
> >               return LPS_DEEP_MODE_PG;
> 
> However, I'm not saying it's necessarily wrong to disable deep PS for
> this chip completely. I'm just objecting to your LLM's conclusions.

I'll consult internally to see if we disable deep PS entirely
for this chip.

My question is that are you 100% sure this can resolve the problem
you encountered? 

Ping-Ke


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-20  2:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20260918232801.119348-1-eexto.ref@aol.com>
2026-09-18 23:28 ` [PATCH rtw-next] wifi: rtw88: 8821c: disable deep LPS on PCIe devices Paolo Lazzaroni
2026-09-19 17:39   ` Bitterblue Smith
2026-09-20  2:36     ` Ping-Ke Shih

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®