From: Mario Limonciello <superm1@kernel.org>
To: Mika Westerberg <mika.westerberg@linux.intel.com>,
Marco Sousa <marcomsousa@gmail.com>
Cc: linux-usb@vger.kernel.org, linux-pci@vger.kernel.org,
linux-pm@vger.kernel.org, westeri@kernel.org,
bhelgaas@google.com, lukas@wunner.de, rafael@kernel.org,
Shyam-sundar.S-k@amd.com
Subject: Re: [BUG] AMD Strix Point USB4 (1022:150a): mid-s2idle pciehp hot-add causes D3cold->D0 failure and hard hang
Date: Mon, 30 Nov 2026 17:23:14 -0600 [thread overview]
Message-ID: <d3f29e0d-7422-4ced-9f4a-6408f172e6e9@kernel.org> (raw)
In-Reply-To: <20261130063324.GG953667@black.igk.intel.com>
[-- Attachment #1: Type: text/plain, Size: 2850 bytes --]
On 11/30/26 00:33, Mika Westerberg wrote:
> Hi,
>
> On Sat, Nov 28, 2026 at 08:55:43AM +0100, Marco Sousa wrote:
>> Hi Mika,
>>
>> Thanks for the quick reply!
>>
>> 1. BIOS version:
>> Confirmed, UM5606WA.321 (built 2025-10-14, published 2025-11-20 on
>> ASUS Support) is the latest official BIOS for the ASUS Zenbook S 16
>> UM5606WA.
>>
>> 2. ACPI dump & _DSD check:
>> I captured an acpidump (MSDM stripped) and extracted the relevant
>> INTGPPC_ SSDT ASL blocks and attached both to Bug 222327:
>> https://bugzilla.kernel.org/show_bug.cgi?id=222327
>>
>> Quick summary of what is in SSDT "INTGPPC_" for GPP0 (0000:00:01.1)
>> and NHI0 (0000:c6:00.5):
>> - \_SB.PCI0.GPP0 (and GPP1) has all four _DSD UUIDs:
>> * fdf06fad-f744-4451-bb64-ecd792215b10:
>> FundamentalDeviceResetTriggeredOnD3ToD0 = 1
>> * 6211e2c0-58a3-4af3-90e1-927a4e0c55a4: HotPlugSupportInD3 = 1
>> * efcc06cc-73ac-4bc3-bff0-76143807c389: ExternalFacingPort = 1, UID = 0
>> * daffd814-6eba-4d8c-8a91-bc9bbf4aa301: usb4-host-interface =
>> \_SB.PCI0.GPPC.NHI0, usb4-port-number = 1
>
> This looks correct to me.
>
>> * _S0W returns \P4D3 (0x04 / D3cold), _PRW returns {0x1A, 0x04},
>> _PR0/_PR3 = PWRS (dummy PW3S flag).
>> - \_SB.PCI0.GPPC.XHC3.RHUB.PRT2 (and XHC4) also has usb4-host-interface
>> pointing to NHI0 (and NHI1).
>> - \_SB.PCI0.GPPC.NHI0 (and NHI1) has NO _DSD block at all; _S0W returns
>> \G5D3 (0x04), _PRW returns {0x1A, 0x00} (comment says {0x1A, 0x04}),
>> and _PS3 calls CpmSendPmeTurnOff(0, 1, 1) + \_SB.ALIB(0x14, 1).
>> - \_GPE._L1A exists and emits Notify(..., 0x02) on GPPC, NHI0/1,
>> XHC0/3/4, GPP0/1, and SWUS. However, in Linux
>> /sys/firmware/acpi/interrupts/gpe1A shows:
>> 0 EN enabled unmasked
>> — GPE 0x1A never fires when tb_tunnel_pci() activates 0:5 <-> 2:9
>> while 0000:00:01.1 is in D3cold.
>
> I do remember that some AMD systems had similar issue? That the hotplug/PME
> GPE did not trigger. Not sure if that was fixed on the BIOS side. Anyways
> let's wait for the AMD folks to chime in.
So in talking to Shyam offline and looking at some tickets the wake
sequence should be coming through PCIEXP_WAKE_STS which AFAICT we are
not using.
- ACPICA's fixed-event table has five entries and bit 14 is not one of
them, so acpi_ev_fixed_event_detect() ignores it. An SCI raised from it
is reported unhandled.
- The bit is only cleared in acpi_hw_clear_acpi_status() on S3
transitions. Nothing touches it in S0 or s2idle.
- acpi_s2idle_wake() validates wakeups with
acpi_any_fixed_event_status_set(), which also ignores it, so a PCIe wake
delivered this way during s2idle is treated as spurious.
Can you please try this attached patch with dyndbg="file
drivers/pci/pci-acpi.c +p" in place?
[-- Attachment #2: 0001-PCI-ACPI-Handle-PCIe-wake-events-signaled-through-PM.patch --]
[-- Type: text/x-patch, Size: 11759 bytes --]
From 2e08cd9a3a3bd9165f72bdfceb65cbeecfeed143 Mon Sep 17 00:00:00 2001
From: Mario Limonciello <mario.limonciello@amd.com>
Date: Mon, 30 Nov 2026 17:19:03 -0600
Subject: [PATCH] PCI/ACPI: Handle PCIe wake events signaled through PM1
PCIEXP_WAKE_STS
ACPI 6.5, Section 4.8.4.1.1 defines PCIEXP_WAKE_STS in the PM1 Status
register. Hardware sets it when the PCIe WAKE# pin is asserted, a Root
Port is in the beacon state or a Root Port receives a PME Message. The
spec describes it as a non-S0 to S0 wake status bit, but some platforms
also raise the SCI from it while in S0 and use it as the only indication
that a Root Port in D3 signaled PME.
On AMD Strix Point the FCH routes PME Messages coming from the PCIe
controller to PM1_STS[PCIEXP_WAKE_STS] and raises the SCI when
PM1_EN[PCIEXP_WAKE_DIS] is clear. No GPE is associated with that event.
This matters for the Root Ports whose downstream link is a USB4 PCIe
tunnel: they runtime suspend into D3cold (via a power resource) as soon
as the tunnel is torn down and are expected to signal PME when the
tunnel comes back up and the hot-plug controller sees presence detect
change.
Linux never looks at PCIEXP_WAKE_STS outside of acpi_hw_clear_acpi_status()
during S3 transitions. ACPICA does not treat it as a fixed event, so
acpi_ev_fixed_event_detect() ignores it, the SCI is reported as unhandled
and the Root Port stays in D3cold forever. Likewise acpi_s2idle_wake()
relies on acpi_any_fixed_event_status_set(), which also ignores it, so a
PCIe wake signaled this way during suspend-to-idle is treated as spurious.
The visible symptom on an ASUS Zenbook S 16 UM5606WA docked to a
Thunderbolt dock is that the tunneled Root Port 0000:00:01.1 never
enumerates the dock after the tunnel is activated. Later, the first
s2idle entry runtime resumes the port in the middle of device suspend,
pciehp hot-adds the dock concurrently with the suspend sequence, the
devices below it end up inaccessible and the system hard hangs.
Waking the Root Port once by hand before suspending avoids all of that.
Add handling for PCIEXP_WAKE_STS to the PCI/ACPI glue:
- Install an ACPICA SCI handler. When the status bit is set, mask the
event through PCIEXP_WAKE_DIS (unless firmware already had it set),
clear the status and schedule a work item. Masking is needed because
the inputs to the status bit are level-sensitive, so clearing the
status alone would not deassert the SCI while the source is pending.
- In the work item, look for the source of the event. Root Ports in
D3hot or shallower (and the devices below them) are checked for PME
Status and resumed if it is set. Root Ports in D0 are skipped as the
native PME service handles PMEs received by those. A Root Port in
D3cold cannot be queried, so resume the hot-plug capable ones that
were armed for wakeup, which is what a hot-plug event on a tunneled
port looks like. If no evidence is found at all, resume every Root
Port in D3cold armed for wakeup once and back off exponentially (up
to 30 s) before unmasking again so that an unclaimed level cannot
keep the system busy or keep waking ports.
- Register a wakeup handler on the SCI so that acpi_s2idle_wake() treats
a set PCIEXP_WAKE_STS as a genuine wakeup reason.
- Flush the work from a PM notifier so that the system never enters
suspend with the event masked.
The handler is only installed on legacy (non reduced hardware) systems
whose FADT advertises PCIEXP_WAKE support.
Reported-by: Marco Sousa <marcomsousa@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=222327
Link: https://lore.kernel.org/linux-usb/CAHRsBfbYF3wocif+a0FRyBBkhcL+FtKF2qm=ne0jgLCzL8cH9w@mail.gmail.com/
---
drivers/pci/pci-acpi.c | 236 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 236 insertions(+)
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index 1150f2fbabf41..17062eefa993f 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -20,6 +20,7 @@
#include <linux/pm_runtime.h>
#include <linux/pm_qos.h>
#include <linux/rwsem.h>
+#include <linux/suspend.h>
#include "pci.h"
/*
@@ -888,6 +889,241 @@ acpi_status pci_acpi_add_pm_notifier(struct acpi_device *dev,
return acpi_add_pm_notifier(dev, &pci_dev->dev, pci_acpi_wake_dev);
}
+/*
+ * PM1 PCIEXP_WAKE_STS handling.
+ *
+ * ACPI 6.5, Section 4.8.4.1.1: PCIEXP_WAKE_STS is set by hardware when the
+ * PCIe WAKE# pin is asserted, a Root Port is in the beacon state or a Root
+ * Port receives a PME Message. The spec describes it as a non-S0 to S0 wake
+ * status bit, but some platforms (AMD FCH for instance) also raise the SCI
+ * from it in S0 and use it as the only indication that a Root Port in D3
+ * signaled PME, e.g. due to a hot-plug event on a port whose downstream
+ * link is a USB4 PCIe tunnel. No GPE is associated with it in that case.
+ *
+ * ACPICA does not treat PCIEXP_WAKE_STS as a fixed event, so nothing ever
+ * consumes it: the SCI is reported as unhandled and the Root Port never
+ * resumes. Handle it here by looking for Root Ports with PME pending and
+ * resuming them.
+ */
+static atomic_t pci_acpi_pciexp_wake_masked;
+static unsigned int pci_acpi_pciexp_wake_misses;
+static struct work_struct pci_acpi_pciexp_wake_work;
+static struct delayed_work pci_acpi_pciexp_wake_unmask_work;
+
+static void pci_acpi_pciexp_wake_unmask_fn(struct work_struct *work)
+{
+ if (!atomic_xchg(&pci_acpi_pciexp_wake_masked, 0))
+ return;
+
+ /* Clear stale status so that only a new event re-triggers the SCI */
+ acpi_write_bit_register(ACPI_BITREG_PCIEXP_WAKE_STATUS,
+ ACPI_CLEAR_STATUS);
+ acpi_write_bit_register(ACPI_BITREG_PCIEXP_WAKE_DISABLE, 0);
+}
+
+static void pci_acpi_pciexp_wake_resume(struct pci_dev *dev, int *found)
+{
+ pci_dbg(dev, "resuming for PCIe wake event\n");
+ pci_wakeup_event(dev);
+ pm_request_resume(&dev->dev);
+ (*found)++;
+}
+
+static int pci_acpi_pciexp_wake_check_dev(struct pci_dev *dev, void *data)
+{
+ /* Config space of a device in D3cold cannot be read */
+ if (dev->current_state == PCI_D3cold)
+ return 0;
+
+ if (pci_check_pme_status(dev)) {
+ if (dev->pme_poll)
+ dev->pme_poll = false;
+
+ pci_acpi_pciexp_wake_resume(dev, data);
+ }
+
+ return 0;
+}
+
+static bool pci_acpi_pciexp_wake_root_port(struct pci_dev *dev)
+{
+ return pci_is_pcie(dev) &&
+ pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT;
+}
+
+static void pci_acpi_pciexp_wake_work_fn(struct work_struct *work)
+{
+ struct pci_dev *port = NULL;
+ unsigned long delay = 0;
+ int found = 0;
+
+ /*
+ * A Root Port in D3hot or a shallower state (and the devices below
+ * it) can be asked whether it has PME pending. A Root Port in
+ * D3cold cannot be, but one armed for wakeup that is hot-plug capable
+ * is the most likely source: it signals PME on presence detect or
+ * data link layer state changes while in D3.
+ */
+ for_each_pci_dev(port) {
+ int before = found;
+
+ if (!pci_acpi_pciexp_wake_root_port(port))
+ continue;
+
+ if (port->current_state == PCI_D3cold) {
+ if (port->wakeup_prepared && port->is_hotplug_bridge)
+ pci_acpi_pciexp_wake_resume(port, &found);
+ continue;
+ }
+
+ /* PMEs received by a Root Port in D0 are handled natively */
+ if (port->current_state == PCI_D0)
+ continue;
+
+ pci_acpi_pciexp_wake_check_dev(port, &found);
+ if (port->subordinate)
+ pci_walk_bus(port->subordinate,
+ pci_acpi_pciexp_wake_check_dev, &found);
+
+ /*
+ * The Root Port could not signal the interrupt for this PME
+ * while in D3hot, so nothing else is going to clear it.
+ */
+ if (found != before)
+ pcie_clear_root_pme_status(port);
+ }
+
+ if (found) {
+ pci_acpi_pciexp_wake_misses = 0;
+ goto unmask;
+ }
+
+ /*
+ * No evidence found. The first time around, assume it was WAKE#
+ * from something below a Root Port in D3cold and resume every such
+ * Root Port armed for wakeup. The inputs to PCIEXP_WAKE_STS are
+ * level-sensitive, so if the event keeps coming back without anyone
+ * claiming it, leave it masked for increasingly long periods instead
+ * of waking those ports over and over again.
+ */
+ if (!pci_acpi_pciexp_wake_misses) {
+ for_each_pci_dev(port) {
+ if (pci_acpi_pciexp_wake_root_port(port) &&
+ port->current_state == PCI_D3cold &&
+ port->wakeup_prepared)
+ pci_acpi_pciexp_wake_resume(port, &found);
+ }
+ }
+
+ pr_debug("PCI/ACPI: PCIe wake status set but no device claimed it\n");
+ delay = min(HZ << pci_acpi_pciexp_wake_misses, 30 * HZ);
+ if (pci_acpi_pciexp_wake_misses < 5)
+ pci_acpi_pciexp_wake_misses++;
+
+unmask:
+ mod_delayed_work(system_wq, &pci_acpi_pciexp_wake_unmask_work, delay);
+}
+
+/*
+ * Called by ACPICA for every SCI, at interrupt level with the GPE lock held.
+ */
+static u32 pci_acpi_pciexp_wake_sci(void *context)
+{
+ u32 sts, dis;
+
+ if (ACPI_FAILURE(acpi_read_bit_register(ACPI_BITREG_PCIEXP_WAKE_STATUS,
+ &sts)) || !sts)
+ return ACPI_INTERRUPT_NOT_HANDLED;
+
+ /*
+ * Mask the event while it is being processed. Clearing the status
+ * alone is not enough to deassert the SCI if the source (a Root Port
+ * with PME pending) is still asserting its input. Leave the mask
+ * alone if the firmware had already set it.
+ */
+ if (ACPI_SUCCESS(acpi_read_bit_register(ACPI_BITREG_PCIEXP_WAKE_DISABLE,
+ &dis)) && !dis) {
+ acpi_write_bit_register(ACPI_BITREG_PCIEXP_WAKE_DISABLE, 1);
+ atomic_set(&pci_acpi_pciexp_wake_masked, 1);
+ }
+ acpi_write_bit_register(ACPI_BITREG_PCIEXP_WAKE_STATUS,
+ ACPI_CLEAR_STATUS);
+
+ schedule_work(&pci_acpi_pciexp_wake_work);
+
+ return ACPI_INTERRUPT_HANDLED;
+}
+
+/*
+ * Called from acpi_s2idle_wake() to decide whether an SCI that woke the
+ * system from suspend-to-idle was a genuine wakeup event. ACPICA only
+ * considers the fixed events it knows about, which do not include
+ * PCIEXP_WAKE_STS, so a PCIe wake signaled this way would otherwise be
+ * treated as spurious and the system would go back to sleep.
+ */
+static bool pci_acpi_pciexp_wake_check(void *context)
+{
+ u32 sts;
+
+ if (ACPI_FAILURE(acpi_read_bit_register(ACPI_BITREG_PCIEXP_WAKE_STATUS,
+ &sts)))
+ return false;
+
+ if (sts)
+ pm_pr_dbg("PCIe wake status set\n");
+
+ return sts;
+}
+
+static int pci_acpi_pciexp_wake_pm_notifier(struct notifier_block *nb,
+ unsigned long action, void *data)
+{
+ switch (action) {
+ case PM_HIBERNATION_PREPARE:
+ case PM_SUSPEND_PREPARE:
+ /* Do not go to sleep with the event masked */
+ flush_work(&pci_acpi_pciexp_wake_work);
+ flush_delayed_work(&pci_acpi_pciexp_wake_unmask_work);
+ break;
+ }
+
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block pci_acpi_pciexp_wake_nb = {
+ .notifier_call = pci_acpi_pciexp_wake_pm_notifier,
+};
+
+static int __init pci_acpi_pciexp_wake_init(void)
+{
+ acpi_status status;
+
+ if (acpi_disabled || acpi_pci_disabled || acpi_gbl_reduced_hardware ||
+ !acpi_sci_irq_valid())
+ return 0;
+
+ if (!(acpi_gbl_FADT.flags & ACPI_FADT_PCI_EXPRESS_WAKE))
+ return 0;
+
+ INIT_WORK(&pci_acpi_pciexp_wake_work, pci_acpi_pciexp_wake_work_fn);
+ INIT_DELAYED_WORK(&pci_acpi_pciexp_wake_unmask_work,
+ pci_acpi_pciexp_wake_unmask_fn);
+
+ status = acpi_install_sci_handler(pci_acpi_pciexp_wake_sci, NULL);
+ if (ACPI_FAILURE(status)) {
+ pr_warn("PCI/ACPI: Failed to install PCIe wake SCI handler: %s\n",
+ acpi_format_exception(status));
+ return 0;
+ }
+
+ acpi_register_wakeup_handler(acpi_sci_irq, pci_acpi_pciexp_wake_check,
+ NULL);
+ register_pm_notifier(&pci_acpi_pciexp_wake_nb);
+
+ return 0;
+}
+device_initcall(pci_acpi_pciexp_wake_init);
+
/*
* _SxD returns the D-state with the highest power
* (lowest D-state number) supported in the S-state "x".
--
2.43.0
prev parent reply other threads:[~2026-11-30 23:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 21:40 [BUG] AMD Strix Point USB4 (1022:150a): mid-s2idle pciehp hot-add causes D3cold->D0 failure and hard hang Marco Sousa
2026-11-26 6:48 ` Mika Westerberg
2026-11-28 7:55 ` Marco Sousa
2026-11-30 6:33 ` Mika Westerberg
2026-11-30 23:23 ` Mario Limonciello [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d3f29e0d-7422-4ced-9f4a-6408f172e6e9@kernel.org \
--to=superm1@kernel.org \
--cc=Shyam-sundar.S-k@amd.com \
--cc=bhelgaas@google.com \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=marcomsousa@gmail.com \
--cc=mika.westerberg@linux.intel.com \
--cc=rafael@kernel.org \
--cc=westeri@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox