public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH rtw-next] wifi: rtw88: add quirks to disable PCI ASPM and deep LPS for HP P3S95EA#ACB
@ 2026-03-16  3:56 Ping-Ke Shih
  2026-03-17  0:48 ` LB F
  0 siblings, 1 reply; 3+ messages in thread
From: Ping-Ke Shih @ 2026-03-16  3:56 UTC (permalink / raw)
  To: linux-wireless; +Cc: goainwo

On an HP laptop (P3S95EA#ACB) equipped with a Realtek RTL8821CE 802.11ac
PCIe adapter (PCI ID: 10ec:c821), the system experiences a hard lockup
(complete freeze of the UI and kernel, sysrq doesn't work, requires
holding the power button) when the WiFi adapter enters the power
saving state. Disable PCI ASPM to avoid system freeze.

In addition, driver throws messages periodically. Though this doesn't
always cause unstable connection, missing H2C commands might cause
unpredictable results. Disable deep LPS to avoid this as well.

 rtw88_8821ce 0000:13:00.0: firmware failed to leave lps state
 rtw88_8821ce 0000:13:00.0: failed to send h2c command
 rtw88_8821ce 0000:13:00.0: failed to send h2c command

Reported-by: Oleksandr Havrylov <goainwo@gmail.com>
Closes: https://lore.kernel.org/linux-wireless/CALdGYqSQ1Ko2TTBhUizMu_FvLMUAuQfFrVwS10n_C-LSQJQQkQ@mail.gmail.com/
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw88/main.h |  5 ++++
 drivers/net/wireless/realtek/rtw88/pci.c  | 31 +++++++++++++++++++++++
 2 files changed, 36 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw88/main.h b/drivers/net/wireless/realtek/rtw88/main.h
index 1179231a672d..9c0b746540b0 100644
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -432,6 +432,11 @@ enum rtw_wow_flags {
 	RTW_WOW_FLAG_MAX,
 };
 
+enum rtw_quirk_dis_caps {
+	QUIRK_DIS_CAP_PCI_ASPM,
+	QUIRK_DIS_CAP_LPS_DEEP,
+};
+
 /* the power index is represented by differences, which cck-1s & ht40-1s are
  * the base values, so for 1s's differences, there are only ht20 & ofdm
  */
diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c
index ec0a45bfb670..bba370ad510c 100644
--- a/drivers/net/wireless/realtek/rtw88/pci.c
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
@@ -2,6 +2,7 @@
 /* Copyright(c) 2018-2019  Realtek Corporation
  */
 
+#include <linux/dmi.h>
 #include <linux/module.h>
 #include <linux/pci.h>
 #include "main.h"
@@ -1744,6 +1745,34 @@ const struct pci_error_handlers rtw_pci_err_handler = {
 };
 EXPORT_SYMBOL(rtw_pci_err_handler);
 
+static int rtw_pci_disable_caps(const struct dmi_system_id *dmi)
+{
+	uintptr_t dis_caps = (uintptr_t)dmi->driver_data;
+
+	if (dis_caps & BIT(QUIRK_DIS_CAP_PCI_ASPM))
+		rtw_pci_disable_aspm = true;
+
+	if (dis_caps & BIT(QUIRK_DIS_CAP_LPS_DEEP))
+		rtw_disable_lps_deep_mode = true;
+
+	return 1;
+}
+
+static const struct dmi_system_id rtw_pci_quirks[] = {
+	{
+		.callback = rtw_pci_disable_caps,
+		.ident = "HP Notebook - P3S95EA#ACB",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "HP Notebook"),
+			DMI_MATCH(DMI_PRODUCT_SKU, "P3S95EA#ACB"),
+		},
+		.driver_data = (void *)(BIT(QUIRK_DIS_CAP_PCI_ASPM) |
+					BIT(QUIRK_DIS_CAP_LPS_DEEP)),
+	},
+	{}
+};
+
 int rtw_pci_probe(struct pci_dev *pdev,
 		  const struct pci_device_id *id)
 {
@@ -1771,6 +1800,8 @@ int rtw_pci_probe(struct pci_dev *pdev,
 	rtwpci = (struct rtw_pci *)rtwdev->priv;
 	atomic_set(&rtwpci->link_usage, 1);
 
+	dmi_check_system(rtw_pci_quirks);
+
 	ret = rtw_core_init(rtwdev);
 	if (ret)
 		goto err_release_hw;

base-commit: 039cd522dc70151da13329a5e3ae19b1736f468a
-- 
2.25.1


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

* Re: [PATCH rtw-next] wifi: rtw88: add quirks to disable PCI ASPM and deep LPS for HP P3S95EA#ACB
  2026-03-16  3:56 [PATCH rtw-next] wifi: rtw88: add quirks to disable PCI ASPM and deep LPS for HP P3S95EA#ACB Ping-Ke Shih
@ 2026-03-17  0:48 ` LB F
  2026-03-17  1:31   ` Ping-Ke Shih
  0 siblings, 1 reply; 3+ messages in thread
From: LB F @ 2026-03-17  0:48 UTC (permalink / raw)
  To: Ping-Ke Shih; +Cc: linux-wireless

Ping-Ke Shih <pkshih@realtek.com> wrote:
> On an HP laptop (P3S95EA#ACB) equipped with a Realtek RTL8821CE 802.11ac
> PCIe adapter (PCI ID: 10ec:c821), the system experiences a hard lockup
> (complete freeze of the UI and kernel, sysrq doesn't work, requires
> holding the power button) when the WiFi adapter enters the power
> saving state. Disable PCI ASPM to avoid system freeze.
> In addition, driver throws messages periodically. Though this doesn't
> always cause unstable connection, missing H2C commands might cause
> unpredictable results. Disable deep LPS to avoid this as well.

Tested on HP Notebook P3S95EA#ACB (kernel 6.19.7-1-cachyos):

  - No hard freeze observed during idle or active usage.
  - Zero h2c or lps errors in dmesg across idle (10 min),
    load stress (100MB download), and suspend/resume cycle.
  - Both quirk flags confirmed active via sysfs without any
    manual modprobe parameters.

Tested-by: Oleksandr Havrylov <goainwo@gmail.com>

Best regards,
Oleksandr Havrylov

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

* RE: [PATCH rtw-next] wifi: rtw88: add quirks to disable PCI ASPM and deep LPS for HP P3S95EA#ACB
  2026-03-17  0:48 ` LB F
@ 2026-03-17  1:31   ` Ping-Ke Shih
  0 siblings, 0 replies; 3+ messages in thread
From: Ping-Ke Shih @ 2026-03-17  1:31 UTC (permalink / raw)
  To: LB F; +Cc: linux-wireless@vger.kernel.org

LB F <goainwo@gmail.com> wrote:
> 
> Ping-Ke Shih <pkshih@realtek.com> wrote:
> > On an HP laptop (P3S95EA#ACB) equipped with a Realtek RTL8821CE 802.11ac
> > PCIe adapter (PCI ID: 10ec:c821), the system experiences a hard lockup
> > (complete freeze of the UI and kernel, sysrq doesn't work, requires
> > holding the power button) when the WiFi adapter enters the power
> > saving state. Disable PCI ASPM to avoid system freeze.
> > In addition, driver throws messages periodically. Though this doesn't
> > always cause unstable connection, missing H2C commands might cause
> > unpredictable results. Disable deep LPS to avoid this as well.
> 
> Tested on HP Notebook P3S95EA#ACB (kernel 6.19.7-1-cachyos):
> 
>   - No hard freeze observed during idle or active usage.
>   - Zero h2c or lps errors in dmesg across idle (10 min),
>     load stress (100MB download), and suspend/resume cycle.
>   - Both quirk flags confirmed active via sysfs without any
>     manual modprobe parameters.

Thanks for your test. I'd add this information to commit message
during getting merged. 

> 
> Tested-by: Oleksandr Havrylov <goainwo@gmail.com>
> 

As well as your Tested-by.

Ping-Ke


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

end of thread, other threads:[~2026-03-17  1:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-16  3:56 [PATCH rtw-next] wifi: rtw88: add quirks to disable PCI ASPM and deep LPS for HP P3S95EA#ACB Ping-Ke Shih
2026-03-17  0:48 ` LB F
2026-03-17  1:31   ` 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