Skip to contentSkip to conversation

wifi: rtw88: add quirks to disable PCI ASPM for HP P3S95EA#ACB

RFT rtw-next Ping-Ke Shih 2 participants 2 messages Mar 11 Realtek wireless driver (rtw88)

lore
Share & tools
lore

Ping-Ke Shih

author maintainer
#0 lore raw

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.

Add a quirk to disable ASPM.

---
 drivers/net/wireless/realtek/rtw88/pci.c | 30 ++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
drivers/net/wireless/realtek/rtw88/pci.c +30 -0
index ec0a45bfb670..0b60a0ce96a1 100644
@@ -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);
 
+enum rtw88_quirk_dis_pci_caps {
+	QUIRK_DIS_PCI_CAP_ASPM,
+};
+
+static int disable_pci_caps(const struct dmi_system_id *dmi)
+{
+	uintptr_t dis_caps = (uintptr_t)dmi->driver_data;
+
+	if (dis_caps & BIT(QUIRK_DIS_PCI_CAP_ASPM))
+		rtw_pci_disable_aspm = true;
+
+	return 1;
+}
+
+static const struct dmi_system_id rtw88_pci_quirks[] = {
+	{
+		.callback = disable_pci_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_PCI_CAP_ASPM),
+	},
+	{}
+};
+
 int rtw_pci_probe(struct pci_dev *pdev,
 		  const struct pci_device_id *id)
 {
@@ -1808,6 +1837,7 @@ int rtw_pci_probe(struct pci_dev *pdev,
 	    bridge && bridge->vendor == PCI_VENDOR_ID_INTEL)
 		rtwpci->rx_no_aspm = true;
 
+	dmi_check_system(rtw88_pci_quirks);
 	rtw_pci_phy_cfg(rtwdev);
 
 	ret = rtw_register_hw(rtwdev, hw);
Signature · 1 line
2.25.1
Tested-by
#1 lore raw

Hi Ping-Ke,

I successfully applied your patch out-of-tree and performed rigorous testing on the host machine.

I can officially confirm that the patch works flawlessly. The DMI quirk triggered correctly and successfully prevented the hardware-level PCIe bus lockups on my HP P3S95EA#ACB.

Testing Environment & Methodology:
- Kernel: CachyOS Linux 6.19.6-2-cachyos x86_64
- Toolchain: Clang/LLVM 21.1.8 (make CC=clang LLVM=1 modules)
- Extraction: We fetched the strict drivers/net/wireless/realtek/rtw88 sub-tree out of the torvalds/linux v6.19 tree utilizing git sparse-checkout to cleanly apply the patch without having to compile the entire 2.5GB+ kernel.
- The resulting .ko object files were compressed to .zst and installed successfully over the generic CachyOS system driver objects.

Verification Conditions:
- Removed ALL local workarounds. disable_aspm=Y is no longer forced via /etc/modprobe.d/ overrides.
- Power saving remains natively ON wifi.powersave = 3 (managed by NetworkManager).
- Left the laptop in multiple 5-10 minute complete idle states to enforce sleep modes.

Post-Boot Log Analysis & Potential Improvement Proposition:
The system remained 100% stable without any kernel panics or UI freezes. However, I continuously monitored the dmesg ring buffer and noticed an intriguing behavior. While the laptop sits completely idle (NetworkManager connected, but no active traffic), the rtw88 driver starts flooded the logs with thousands of firmware errors:

[ 1084.746485] rtw88_8821ce 0000:13:00.0: firmware failed to leave lps state
[ 1084.749662] rtw88_8821ce 0000:13:00.0: failed to send h2c command
[ 1084.752895] rtw88_8821ce 0000:13:00.0: failed to send h2c command

If my understanding of this architecture is correct, previously, when ASPM wasn't disabled, this exact failure of the adapter firmare inside LPS_DEEP_MODE_LCLK would violently lock up the PCIe bus and crash the host. Now, thanks to your DMI ASPM quirk at the rtw88_pci level, the host PCIe controller doesn't enter L1 and is perfectly shielded from the adapter locking itself up! The OS handles the timeouts gracefully and driver recovery prevents a hard freeze.

A question for your consideration: Given the immense volume of these h2c timeout errors (and the underlying firmware's fundamental inability to cleanly enter/exit its own sleep states without L1 participation on this HP model), do you think it would be beneficial to *also* dynamically disable LPS Deep sleep when this specific ASPM quirk is triggered?

For example, dynamically forcing rtwdev->lps_conf.deep_mode = LPS_DEEP_MODE_NONE when the DMI ASPM flag is active, strictly to prevent the firmware from attempting a sleep cycle that is doomed to fail and polluting the queues and logs? Perhaps this might also save microscopic CPU interrupts from continuous H2C polling timeouts?

If you believe that simply letting the driver recover and tolerating the error spam in dmesg is the preferred/safer upstream approach, I am perfectly happy. The patch functions as advertised and system stability is unequivocally restored!

Thank you immensely for your rapid debugging and definitive patch for this long-standing issue and for bringing stability to this model.

*(Note: I was a bit unsure which of the two active mailing list threads was the most appropriate place for this final report — the original bug discussion or the new RFT patch submission thread — so I replied to both just to ensure it is correctly attached to the patch. Apologies for the duplicate email!)*

Best regards,
Oleksandr Havrylov

ср, 11 мар. 2026 г. в 04:08, Ping-Ke Shih <[email protected]>:

Quoted 74 lines

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.

Add a quirk to disable ASPM.

---
 drivers/net/wireless/realtek/rtw88/pci.c | 30 ++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
drivers/net/wireless/realtek/rtw88/pci.c +30 -1
index ec0a45bfb670..0b60a0ce96a1 100644
@@ -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);
 
+enum rtw88_quirk_dis_pci_caps {
+       QUIRK_DIS_PCI_CAP_ASPM,
+};
+
+static int disable_pci_caps(const struct dmi_system_id *dmi)
+{
+       uintptr_t dis_caps = (uintptr_t)dmi->driver_data;
+
+       if (dis_caps & BIT(QUIRK_DIS_PCI_CAP_ASPM))
+               rtw_pci_disable_aspm = true;
+
+       return 1;
+}
+
+static const struct dmi_system_id rtw88_pci_quirks[] = {
+       {
+               .callback = disable_pci_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_PCI_CAP_ASPM),
+       },
+       {}
+};
+
 int rtw_pci_probe(struct pci_dev *pdev,
                  const struct pci_device_id *id)
 {
@@ -1808,6 +1837,7 @@ int rtw_pci_probe(struct pci_dev *pdev,
            bridge && bridge->vendor == PCI_VENDOR_ID_INTEL)
                rtwpci->rx_no_aspm = true;
 
+       dmi_check_system(rtw88_pci_quirks);
        rtw_pci_phy_cfg(rtwdev);
 
        ret = rtw_register_hw(rtwdev, hw);
--

2.25.1