mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 1/2] wifi: rtw88: pci: Add DMI quirk for HP Laptop 15s-fr5xxx
@ 2026-11-03  3:14 Kalpesh Solanki
  2026-11-03  3:14 ` [PATCH v2 2/2] wifi: rtw88: ps: Trigger firmware recovery when failing to leave LPS state Kalpesh Solanki
  2026-11-03  5:54 ` [PATCH v2 1/2] wifi: rtw88: pci: Add DMI quirk for HP Laptop 15s-fr5xxx Ping-Ke Shih
  0 siblings, 2 replies; 5+ messages in thread
From: Kalpesh Solanki @ 2026-11-03  3:14 UTC (permalink / raw)
  To: pkshih, kvalo; +Cc: linux-wireless, linux-kernel, Kalpesh Solanki

On the HP Laptop 15s-fr5xxx with RTL8822CE, PCIe ASPM L1/L1.2 and deep LPS
cause the card's firmware to fail to resume from low-power states,
resulting in repeated 'firmware failed to leave lps state' and
'failed to send h2c command' errors and stalled network traffic.

Add a DMI quirk entry for 'HP Laptop 15s-fr5xxx' to disable PCIe ASPM
and deep LPS, ensuring reliable Wi-Fi operation.

Signed-off-by: Kalpesh Solanki <skalpesh942@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
---
v2:
 - Rebase onto rtw-next.
 - Pick up Acked-by from Ping-Ke Shih.

 drivers/net/wireless/realtek/rtw88/pci.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c
index 66d2e5f5144..c87de645083 100644
--- a/drivers/net/wireless/realtek/rtw88/pci.c
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
@@ -1779,6 +1779,16 @@ static const struct dmi_system_id rtw_pci_quirks[] = {
 		.driver_data = (void *)(BIT(QUIRK_DIS_CAP_PCI_ASPM) |
 					BIT(QUIRK_DIS_CAP_LPS_DEEP)),
 	},
+	{
+		.callback = rtw_pci_disable_caps,
+		.ident = "HP Laptop 15s-fr5xxx",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "HP Laptop 15s-fr5xxx"),
+		},
+		.driver_data = (void *)(BIT(QUIRK_DIS_CAP_PCI_ASPM) |
+					BIT(QUIRK_DIS_CAP_LPS_DEEP)),
+	},
 	{
 		.callback = rtw_pci_disable_caps,
 		.ident = "ASUS TUF Gaming A15 FA506II",
-- 
2.53.0


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

* [PATCH v2 2/2] wifi: rtw88: ps: Trigger firmware recovery when failing to leave LPS state
  2026-11-03  3:14 [PATCH v2 1/2] wifi: rtw88: pci: Add DMI quirk for HP Laptop 15s-fr5xxx Kalpesh Solanki
@ 2026-11-03  3:14 ` Kalpesh Solanki
  2026-11-03  3:17   ` Ping-Ke Shih
  2026-11-06 15:33   ` Luka Gejak
  2026-11-03  5:54 ` [PATCH v2 1/2] wifi: rtw88: pci: Add DMI quirk for HP Laptop 15s-fr5xxx Ping-Ke Shih
  1 sibling, 2 replies; 5+ messages in thread
From: Kalpesh Solanki @ 2026-11-03  3:14 UTC (permalink / raw)
  To: pkshih, kvalo; +Cc: linux-wireless, linux-kernel, Kalpesh Solanki

When rtw_fw_leave_lps_check() fails, the firmware has locked up or
failed to exit its low power state. Currently, the driver only logs
'firmware failed to leave lps state' and clears REG_TCR, leaving the
hardware in an unresponsive state where subsequent H2C commands fail
and TX traffic hangs indefinitely.

Call rtw_fw_recovery() when rtw_fw_leave_lps_check() fails so the driver
can automatically reset the hardware and re-sync without requiring manual
user intervention.

Signed-off-by: Kalpesh Solanki <skalpesh942@gmail.com>
---
v2:
 - Rebase onto rtw-next.

 drivers/net/wireless/realtek/rtw88/ps.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/realtek/rtw88/ps.c b/drivers/net/wireless/realtek/rtw88/ps.c
index add5a20b843..8dba60f3464 100644
--- a/drivers/net/wireless/realtek/rtw88/ps.c
+++ b/drivers/net/wireless/realtek/rtw88/ps.c
@@ -166,6 +166,7 @@ static void rtw_fw_leave_lps_check(struct rtw_dev *rtwdev)
 		rtw_write32_clr(rtwdev, REG_TCR, BIT_PWRMGT_HWDATA_EN);
 		rtw_warn(rtwdev, "firmware failed to leave lps state\n");
 		rtw_fw_dump_dbg_info(rtwdev);
+		rtw_fw_recovery(rtwdev);
 	}
 }
 
-- 
2.53.0


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

* RE: [PATCH v2 2/2] wifi: rtw88: ps: Trigger firmware recovery when failing to leave LPS state
  2026-11-03  3:14 ` [PATCH v2 2/2] wifi: rtw88: ps: Trigger firmware recovery when failing to leave LPS state Kalpesh Solanki
@ 2026-11-03  3:17   ` Ping-Ke Shih
  2026-11-06 15:33   ` Luka Gejak
  1 sibling, 0 replies; 5+ messages in thread
From: Ping-Ke Shih @ 2026-11-03  3:17 UTC (permalink / raw)
  To: Kalpesh Solanki, kvalo; +Cc: linux-wireless, linux-kernel

Kalpesh Solanki <skalpesh942@gmail.com> wrote:
> When rtw_fw_leave_lps_check() fails, the firmware has locked up or
> failed to exit its low power state. Currently, the driver only logs
> 'firmware failed to leave lps state' and clears REG_TCR, leaving the
> hardware in an unresponsive state where subsequent H2C commands fail
> and TX traffic hangs indefinitely.
> 
> Call rtw_fw_recovery() when rtw_fw_leave_lps_check() fails so the driver
> can automatically reset the hardware and re-sync without requiring manual
> user intervention.
> 
> Signed-off-by: Kalpesh Solanki <skalpesh942@gmail.com>

Acked-by: Ping-Ke Shih <pkshih@realtek.com>



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

* Re: [PATCH v2 1/2] wifi: rtw88: pci: Add DMI quirk for HP Laptop 15s-fr5xxx
  2026-11-03  3:14 [PATCH v2 1/2] wifi: rtw88: pci: Add DMI quirk for HP Laptop 15s-fr5xxx Kalpesh Solanki
  2026-11-03  3:14 ` [PATCH v2 2/2] wifi: rtw88: ps: Trigger firmware recovery when failing to leave LPS state Kalpesh Solanki
@ 2026-11-03  5:54 ` Ping-Ke Shih
  1 sibling, 0 replies; 5+ messages in thread
From: Ping-Ke Shih @ 2026-11-03  5:54 UTC (permalink / raw)
  To: Kalpesh Solanki, pkshih, kvalo
  Cc: linux-wireless, linux-kernel, Kalpesh Solanki

Kalpesh Solanki <skalpesh942@gmail.com> wrote:

> On the HP Laptop 15s-fr5xxx with RTL8822CE, PCIe ASPM L1/L1.2 and deep LPS
> cause the card's firmware to fail to resume from low-power states,
> resulting in repeated 'firmware failed to leave lps state' and
> 'failed to send h2c command' errors and stalled network traffic.
> 
> Add a DMI quirk entry for 'HP Laptop 15s-fr5xxx' to disable PCIe ASPM
> and deep LPS, ensuring reliable Wi-Fi operation.
> 
> Signed-off-by: Kalpesh Solanki <skalpesh942@gmail.com>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>

2 patch(es) applied to rtw-next branch of rtw.git, thanks.

04c998418722 wifi: rtw88: pci: Add DMI quirk for HP Laptop 15s-fr5xxx
dc16902cad9c wifi: rtw88: ps: Trigger firmware recovery when failing to leave LPS state

---
https://github.com/pkshih/rtw.git


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

* Re: [PATCH v2 2/2] wifi: rtw88: ps: Trigger firmware recovery when failing to leave LPS state
  2026-11-03  3:14 ` [PATCH v2 2/2] wifi: rtw88: ps: Trigger firmware recovery when failing to leave LPS state Kalpesh Solanki
  2026-11-03  3:17   ` Ping-Ke Shih
@ 2026-11-06 15:33   ` Luka Gejak
  1 sibling, 0 replies; 5+ messages in thread
From: Luka Gejak @ 2026-11-06 15:33 UTC (permalink / raw)
  To: Kalpesh Solanki, pkshih, kvalo
  Cc: linux-wireless, linux-kernel, Kalpesh Solanki

Hi Kalpesh,

Thanks for the patch. I know this is already applied, but I have two
comments.

November 3, 2026 at 4:14 AM, "Kalpesh Solanki" <skalpesh942@gmail.com> wrote:

> diff --git a/drivers/net/wireless/realtek/rtw88/ps.c b/drivers/net/wireless/realtek/rtw88/ps.c
> index add5a20b8432..8dba60f3464c 100644
> --- a/drivers/net/wireless/realtek/rtw88/ps.c
> +++ b/drivers/net/wireless/realtek/rtw88/ps.c
> @@ -166,6 +166,7 @@ static void rtw_fw_leave_lps_check(struct rtw_dev *rtwdev)
>               rtw_write32_clr(rtwdev, REG_TCR, BIT_PWRMGT_HWDATA_EN);
>               rtw_warn(rtwdev, "firmware failed to leave lps state\n");
>               rtw_fw_dump_dbg_info(rtwdev);
> +             rtw_fw_recovery(rtwdev);
>       }
>  }

As far as I can see, this timeout doesn't always mean the firmware is
stuck. The comment in __rtw_fw_leave_lps_check_reg() says REG_TCR is
only restored once the AP has acked the null frame, and 3a2dd6b7cadf
("rtw88: check firmware leave lps successfully") says that frame can
take much longer in a noisy environment. That is why the old code just
cleared the bit and warned.

So if I read it right, a busy channel or a weak link now ends in the
WARN() in __fw_recovery_work() and a full ieee80211_restart_hw(). The
watchdog leaves LPS every two seconds on an idle link, and
BCN_FILTER_NOTIFY_BEACON_LOSS leaves it right when the AP may be gone.
This also reaches USB and SDIO now, which had no way to trigger
rtw_fw_recovery() before.

rtw89 only recovers after RTW89_PS_HANG_MAX_CNT failures in a row.
Would you be willing to send a follow up that does the same here?

There also seems to be a path where the recovery never completes.
rtw_leave_lps() also runs from ieee80211_set_disassoc() through
rtw_recalc_lps(). If the check times out there while the last interface
goes down, or on a suspend without WoWLAN, the queued work runs before
drv_stop(). mac80211 then never calls drv_reconfig_complete() with
IEEE80211_RECONFIG_TYPE_RESTART, so RTW_FLAG_RESTARTING stays set and
rtw_fw_recovery() does nothing until the driver is reloaded, also for
real firmware crashes. Maybe rtw_ops_stop() could clear it as well?

Best regards,
Luka Gejak

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

end of thread, other threads:[~2026-11-06 15:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03  3:14 [PATCH v2 1/2] wifi: rtw88: pci: Add DMI quirk for HP Laptop 15s-fr5xxx Kalpesh Solanki
2026-11-03  3:14 ` [PATCH v2 2/2] wifi: rtw88: ps: Trigger firmware recovery when failing to leave LPS state Kalpesh Solanki
2026-11-03  3:17   ` Ping-Ke Shih
2026-11-06 15:33   ` Luka Gejak
2026-11-03  5:54 ` [PATCH v2 1/2] wifi: rtw88: pci: Add DMI quirk for HP Laptop 15s-fr5xxx 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®