* [REGRESSION] Lunar Lake: s2idle randomly misses S0ix when PCH xHCI (8086:a87d) is runtime-suspended; much worse since 7.3
@ 2026-11-25 9:24 Jun Cheol Gim
2026-11-26 0:20 ` [RFC PATCH] usb: xhci-pci: resume Lunar Lake xHC before system suspend Jason Kim
0 siblings, 1 reply; 3+ messages in thread
From: Jun Cheol Gim @ 2026-11-25 9:24 UTC (permalink / raw)
To: Mathias Nyman, Xi Pardee
Cc: linux-usb, platform-driver-x86, linux-pm, Rafael J. Wysocki,
Rajneesh Bhardwaj, Hans de Goede, Ilpo Järvinen,
Greg Kroah-Hartman, regressions
Hi,
On a Lenovo ThinkPad T14s Gen 6 (Core Ultra 5 228V, Lunar Lake),
s2idle sometimes resumes normally but never reached S0ix: last_hw_sleep
is 0 and the package stays in PC2 for the whole sleep (about 1.7 W
instead of 0.25 W). Since 7.3 this got much more frequent. Full details,
acpidump and logs: https://bugzilla.kernel.org/show_bug.cgi?id=222281
I narrowed it down. If the PCH xHCI controller at 00:14.0 (8086:a87d)
is runtime-suspended (D3hot) when the system suspends, the platform
fails to reach S0ix at random. If it is kept in D0 (power/control=on),
the failures almost go away, on both 7.0 and 7.4-rc4. That is why a
live USB system with a USB stick plugged in never failed (280/280).
Test loop: battery, no external USB devices, screen off, then
rtcwake -m mem -s 8 repeatedly. A cycle counts as OK if the S0i2.2
residency increased. "instr" means pm_debug_messages=1 plus an Intel
PMT telemetry dump around every cycle. That changes the success rate
by itself, so runs are only compared at the same instrumentation
setting.
kernel xHCI 00:14.0 instr OK / total
------------------- -------------------- ----- ---------------
7.0.0-44 (Ubuntu) auto (D3hot, default) no 112 / 130 (86%)
7.0.0-44 (Ubuntu) on (D0) no 99 / 100
v7.4-rc4 auto (D3hot, default) no 5 / 30 (17%)
v7.4-rc4 on (D0) no 95 / 100
7.0.0-44, same boot auto yes 45 / 100
7.0.0-44, same boot on yes 96 / 100
- on vs auto: Fisher p = 1e-12 (7.0, same boot) and 1e-13 (7.4-rc4).
- With xHCI on, 7.0 and 7.4-rc4 cannot be told apart (99% vs 95%,
p = 0.21).
- Caveat on the regression range: mainline v7.0 built with my config
(Ubuntu config plus localmodconfig, checked that all loaded modules
were built) reached only 15/30 with xHCI at "auto". So the clearly
good kernel is Ubuntu's 7.0.0-44 (v7.0.14 plus Ubuntu patches), not
plain v7.0. I have not tested v7.0 with xHCI on.
Failed cycles, according to Intel PMT (LNL aggregators 0x3072105 /
0x3072005, decoded with the public Intel-PMT XML):
- PREVENT_PKGC6_CHIPSET_1 and _2 count for the whole sleep (about 8300
of 8300 ms). In OK cycles they count 40-75 ms.
- The package sits in PC2 and never enters PC10. GT RC6, media C6,
core C6 and memory self-refresh look normal.
- In the unnamed regions telem5 (GUID 0x12057328) and telem6
(0x11646436), most counters do not move at all during a failed sleep.
- The few failures left with xHCI on have the same signature.
- pm_debug_messages shows no "Constraint not met" over several hundred
cycles. The LPS0 _DSM calls always succeed, and the RTC is the only
wake source.
- Nothing read before suspend predicts the outcome. I checked every
32-bit field of all 9 PMT regions and the PMC live status.
Consecutive cycles are independent.
- Real lid-close sleeps behave the same way. An 82 min failed sleep was
blocked by CHIPSET_1/2 for about 4960 s; a 105 min good sleep was
100% PC10.
Workaround in use (one udev rule, split with backslashes):
ACTION=="add|bind|change", SUBSYSTEM=="pci", \
ATTR{vendor}=="0x8086", ATTR{device}=="0xa87d", \
ATTR{power/control}="on"
During suspend I see no cost: OK cycles with on and auto use the same
package and Psys energy. I have not measured the idle cost while the
system is awake.
Questions:
1. Is there a known LNL issue when the PCH xHCI enters system suspend
while already runtime-suspended (direct_complete or similar), as
opposed to from D0? Should xhci-pci resume it before s2idle on this
platform?
2. What do "Chipset 1" and "Chipset 2" in PREVENT_PKGC6_CHIPSET_* cover
on LNL? Can the telem5 and telem6 data narrow down which IP keeps the
package out of PC6? Raw per-cycle dumps are attached to the bugzilla
entry (xhci-pmt-data.tar.gz).
3. I can bisect v7.0..v7.3 with xHCI left at "auto" if that is useful.
Each step needs about 100 cycles (about 30 minutes) to separate the
success rates reliably.
System: BIOS N4IET31W 1.17 (latest), EC 1.12, microcode 0x128,
Kubuntu 26.04, KDE Wayland. The cmdline also has no_console_suspend
(removing it at runtime did not help).
#regzbot link: https://bugzilla.kernel.org/show_bug.cgi?id=222281
Thanks,
Jason Kim
^ permalink raw reply [flat|nested] 3+ messages in thread
* [RFC PATCH] usb: xhci-pci: resume Lunar Lake xHC before system suspend
2026-11-25 9:24 [REGRESSION] Lunar Lake: s2idle randomly misses S0ix when PCH xHCI (8086:a87d) is runtime-suspended; much worse since 7.3 Jun Cheol Gim
@ 2026-11-26 0:20 ` Jason Kim
2026-11-26 0:27 ` sashiko-bot
0 siblings, 1 reply; 3+ messages in thread
From: Jason Kim @ 2026-11-26 0:20 UTC (permalink / raw)
To: Mathias Nyman, Greg Kroah-Hartman
Cc: Jason Kim, linux-usb, linux-pm, platform-driver-x86, regressions,
Rafael J. Wysocki, Xi Pardee, Hans de Goede, Ilpo Järvinen,
Rajneesh Bhardwaj
On a ThinkPad T14s Gen 6 (Lunar Lake), suspend-to-idle often fails to
reach S0ix when the PCH xHC (8086:a87d) is runtime-suspended when the
system suspend starts. The Intel PMT counters show the PCH blocking
package C6 (PREVENT_PKGC6_CHIPSET_1/2) for the whole sleep period, and
the package stays in PC2. No LPS0 constraint is reported as unmet.
A runtime-suspended PCI host controller is runtime-resumed by
pci_pm_suspend() and then suspended again, so it goes through a
D3hot -> D0 -> D3hot cycle in the middle of the system suspend
transition. If the controller is kept active until the transition
starts (power/control set to "on"), S0ix is reached reliably.
Add an HCD flag that makes hcd_pci_prepare() runtime-resume the
controller before any device is suspended, and set it for the Lunar
Lake xHC through a new quirk. The PM core holds a runtime PM reference
from ->prepare() to ->complete(), so the controller stays active until
the system suspend proper and goes from D0 to D3hot once.
Results on v7.4-rc4, battery, 8 s rtcwake cycles, counted as S0ix
entered when last_hw_sleep > 0:
runtime-suspended xHC (unpatched) 0/30, 4/30
power/control=on right before suspend 97/100
with this patch 28/30
The analysis, the patch and this changelog were prepared with the help
of an AI coding assistant (Claude Code). I reviewed the change and ran
the tests above on my machine.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=222281
Link: https://lore.kernel.org/linux-usb/CANb8v8EGmQf90hRvr8cE3vTKOOY8b6LTxki1uORW_TJ9HadrZw@mail.gmail.com/
Signed-off-by: Jason Kim <dialogbox@gmail.com>
---
This follows up on my report in the thread this mail replies to.
Sent as RFC because I have seen this on only one machine, a ThinkPad
T14s Gen 6 (BIOS N4IET31W 1.17), and I cannot tell whether it is a
Lunar Lake issue or specific to this platform and its firmware. The
ACPI power resource of the xHC here is \_SB.PC00.LPCB.EC.PUBS, which
is defined under the EC device, so firmware may well be involved.
Could someone at Intel check whether other Lunar Lake systems show
the same behaviour? Depending on the answer, the quirk could stay on
the PCI ID as in this patch, be limited by DMI, or be dropped in
favour of a firmware fix. I would appreciate advice on which way to
go.
Notes:
- Tested only on v7.4-rc4, on this one machine. The Thunderbolt xHC at
00:0d.0 (8086:a831) is not touched by this change.
- No Fixes: tag. On Ubuntu 7.0 the same failure happens about 14% of
the time and on 7.4-rc4 most of the time, but I have not found the
commit that made it worse, so this works around the trigger rather
than reverting a specific change.
- Resuming 00:14.0 alone in ->prepare() is enough. A debug variant that
resumed both xHCs in ->prepare() gave the same result (29/30), and so
did taking a runtime PM reference from a PM_SUSPEND_PREPARE notifier
(29/30).
- Separate issue, mentioned only because I left it out of the numbers
above: in two boots (one of them with this patch applied) S0ix failed
in every cycle no matter what the xHC did, including with
power/control=on (0/30). In those boots the display DMC
"DC5 -> DC6 allowed count" never increased during sleep, while it
goes up by 15-20 per cycle in every other boot. It does not seem
related to USB, and I will report it separately once I can
reproduce it.
- If a more generic fix is preferred, for example avoiding the runtime
resume in the system suspend path for this device in USB or PCI core,
I am happy to test it.
drivers/usb/core/hcd-pci.c | 21 +++++++++++++++++++++
drivers/usb/host/xhci-pci.c | 14 ++++++++++++++
drivers/usb/host/xhci.h | 1 +
include/linux/usb/hcd.h | 2 ++
4 files changed, 38 insertions(+)
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
index cd223475917e..85df50237e4c 100644
--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -8,6 +8,7 @@
#include <linux/pci.h>
#include <linux/usb.h>
#include <linux/usb/hcd.h>
+#include <linux/pm_runtime.h>
#include <asm/io.h>
#include <asm/irq.h>
@@ -521,6 +522,24 @@ static int resume_common(struct device *dev, pm_message_t msg)
#ifdef CONFIG_PM_SLEEP
+static int hcd_pci_prepare(struct device *dev)
+{
+ struct usb_hcd *hcd = dev_get_drvdata(dev);
+
+ /*
+ * Some host controllers misbehave if they are runtime-resumed and
+ * suspended again in the middle of a system suspend transition, which
+ * is what happens to a runtime-suspended controller in
+ * pci_pm_suspend(). Resume them here instead, before any device is
+ * suspended. The PM core holds a runtime PM reference from now until
+ * ->complete(), so they stay active until the system suspend proper.
+ */
+ if (hcd && hcd->resume_before_system_suspend)
+ pm_runtime_resume(dev);
+
+ return 0;
+}
+
static int hcd_pci_suspend(struct device *dev)
{
return suspend_common(dev, PMSG_SUSPEND);
@@ -599,6 +618,7 @@ static int hcd_pci_restore(struct device *dev)
#else
+#define hcd_pci_prepare NULL
#define hcd_pci_suspend NULL
#define hcd_pci_freeze NULL
#define hcd_pci_suspend_noirq NULL
@@ -631,6 +651,7 @@ static int hcd_pci_runtime_resume(struct device *dev)
}
const struct dev_pm_ops usb_hcd_pci_pm_ops = {
+ .prepare = hcd_pci_prepare,
.suspend = hcd_pci_suspend,
.suspend_noirq = hcd_pci_suspend_noirq,
.resume_noirq = hcd_pci_resume_noirq,
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index e278db940a58..261c77ba794c 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -60,6 +60,7 @@
#define PCI_DEVICE_ID_INTEL_COMET_LAKE_XHCI 0xa3af
#define PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI 0x51ed
#define PCI_DEVICE_ID_INTEL_ALDER_LAKE_N_PCH_XHCI 0x54ed
+#define PCI_DEVICE_ID_INTEL_LUNAR_LAKE_XHCI 0xa87d
#define PCI_VENDOR_ID_PHYTIUM 0x1db7
#define PCI_DEVICE_ID_PHYTIUM_XHCI 0xdc27
@@ -419,6 +420,16 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
pdev->device == PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI))
xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW;
+ /*
+ * If the Lunar Lake xHC goes through a D3hot -> D0 -> D3hot cycle
+ * during system suspend (it is runtime-suspended when the transition
+ * starts), the platform often fails to reach S0ix: the PCH keeps
+ * blocking package C6 for the whole suspend-to-idle period.
+ */
+ if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
+ pdev->device == PCI_DEVICE_ID_INTEL_LUNAR_LAKE_XHCI)
+ xhci->quirks |= XHCI_RESUME_BEFORE_SYSTEM_SUSPEND;
+
if (pdev->vendor == PCI_VENDOR_ID_ETRON &&
(pdev->device == PCI_DEVICE_ID_ETRON_EJ168 ||
pdev->device == PCI_DEVICE_ID_ETRON_EJ188)) {
@@ -679,6 +690,9 @@ int xhci_pci_common_probe(struct pci_dev *dev, const struct pci_device_id *id)
else if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW)
pm_runtime_allow(&dev->dev);
+ if (xhci->quirks & XHCI_RESUME_BEFORE_SYSTEM_SUSPEND)
+ hcd->resume_before_system_suspend = 1;
+
dma_set_max_seg_size(&dev->dev, UINT_MAX);
if (device_property_read_bool(&dev->dev, "ti,pwron-active-high"))
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index ec4bfeb4887c..d3f202cde46b 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1652,6 +1652,7 @@ struct xhci_hcd {
#define XHCI_CDNS_SCTX_QUIRK BIT_ULL(48)
#define XHCI_ETRON_HOST BIT_ULL(49)
#define XHCI_LIMIT_ENDPOINT_INTERVAL_9 BIT_ULL(50)
+#define XHCI_RESUME_BEFORE_SYSTEM_SUSPEND BIT_ULL(51)
unsigned int num_active_eps;
unsigned int limit_active_eps;
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 181db044c4d2..616d334436a1 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -160,6 +160,8 @@ struct usb_hcd {
unsigned tpl_support:1; /* OTG & EH TPL support */
unsigned cant_recv_wakeups:1;
/* wakeup requests from downstream aren't received */
+ unsigned resume_before_system_suspend:1;
+ /* leave runtime suspend in ->prepare of system suspend */
unsigned int irq; /* irq allocated */
void __iomem *regs; /* device memory/io */
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RFC PATCH] usb: xhci-pci: resume Lunar Lake xHC before system suspend
2026-11-26 0:20 ` [RFC PATCH] usb: xhci-pci: resume Lunar Lake xHC before system suspend Jason Kim
@ 2026-11-26 0:27 ` sashiko-bot
0 siblings, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-11-26 0:27 UTC (permalink / raw)
To: Jason Kim; +Cc: linux-usb
> On a ThinkPad T14s Gen 6 (Lunar Lake), suspend-to-idle often fails to
> reach S0ix when the PCH xHC (8086:a87d) is runtime-suspended when the
> system suspend starts. The Intel PMT counters show the PCH blocking
> package C6 (PREVENT_PKGC6_CHIPSET_1/2) for the whole sleep period, and
> the package stays in PC2. No LPS0 constraint is reported as unmet.
>
> A runtime-suspended PCI host controller is runtime-resumed by
> pci_pm_suspend() and then suspended again, so it goes through a
> D3hot -> D0 -> D3hot cycle in the middle of the system suspend
> transition. If the controller is kept active until the transition
> starts (power/control set to "on"), S0ix is reached reliably.
>
> Add an HCD flag that makes hcd_pci_prepare() runtime-resume the
> controller before any device is suspended, and set it for the Lunar
> Lake xHC through a new quirk. The PM core holds a runtime PM reference
> [ ... ]
> the tests above on my machine.
>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=222281
> Link: https://lore.kernel.org/linux-usb/CANb8v8EGmQf90hRvr8cE3vTKOOY8b6LTxki1uORW_TJ9HadrZw@mail.gmail.com/
> Signed-off-by: Jason Kim <dialogbox@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261126002006.25823-1-dialogbox@gmail.com?part=1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-26 0:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 9:24 [REGRESSION] Lunar Lake: s2idle randomly misses S0ix when PCH xHCI (8086:a87d) is runtime-suspended; much worse since 7.3 Jun Cheol Gim
2026-11-26 0:20 ` [RFC PATCH] usb: xhci-pci: resume Lunar Lake xHC before system suspend Jason Kim
2026-11-26 0:27 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox