From: Lukas Wunner <lukas@wunner.de>
To: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
"Rafael J . Wysocki" <rafael@kernel.org>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: Re: [PATCH v3] PCI: pciehp: Fix hotplug on Catlow Lake with unreliable PME status
Date: Wed, 25 Mar 2026 06:56:46 +0100 [thread overview]
Message-ID: <acN5HorrB31LLjiJ@wunner.de> (raw)
In-Reply-To: <ca15feda-5d63-405d-a4c4-00cbb9991fed@linux.intel.com>
On Tue, Mar 24, 2026 at 02:45:25PM -0700, Kuppuswamy Sathyanarayanan wrote:
> On 3/23/2026 4:24 PM, Bjorn Helgaas wrote:
> > eb34da60edee ("PCI: pciehp: Disable hotplug interrupt during suspend")
> > cleared PCI_EXP_SLTCTL_HPIE so that when the link goes down, we
> > wouldn't get a PCI_EXP_SLTSTA_DLLSC interrupt and wake the system.
> >
> > I don't know the details of why the PCI_EXP_SLTSTA_DLLSC would cause
> > that wakeup. I would think pciehp should field that, and it should be
> > able to figure out whether to bring the port out of D3hot.
> >
> > Anyway, with this patch it looks like we'll leave PCI_EXP_SLTCTL_HPIE
> > set, and potentially get that PCI_EXP_SLTSTA_DLLSC interrupt again?
>
> I have tested this patch on Catlow Lake. Enabling HPIE does not result in
> spurious wakeups as mentioned in Mika's patch.
I believe Mika saw the wakeup issue on a Thunderbolt controller when
going into system sleep. (In 2018, only discrete controllers existed.
SoC-integrated controllers were introduced a few years later.)
And Catlow Lake is a server PCH or at least derived from server silicon,
right? Did you test system sleep or just runtime suspend?
> > If we know we got a PME interrupt, and we can wake up (maybe more
> > slowly without a Requester ID), why can't we just do the wakeup
> > independent of PCI_EXP_RTSTA_PME and PCI_EXP_RTSTA_PME_RQ_ID? Are
> > spurious PME interrupts a problem?
>
> Yes, I think we can call pcie_pme_walk_bus() even when PCI_EXP_RTSTA_PME
> is clear for ports with the quirk. This would work but be slower without
> the Requester_ID hint.
The problem is, PME not only shares the interrupt with hotplug
(PCIe r7.0 sec 6.7.3.4), but if INTx is used it also shares the
interrupt with link bandwidth management, AER and DPC. So there's
lots of potential for spurious PME interrupts and I fear waking up
the entire hierarchy below the Root Port on every interrupt may
result in much worse power consumption.
At least Switch Upstream and Downstream Ports below the Root Port
need to be woken to access config space of Endpoints. With Thunderbolt,
these may be in D3cold and waking them up consumes a non-trivial amount
of time and energy.
As an aside, I note that the code in drivers/pci/pcie/pme.c doesn't
take into account that there may be Switch Upstream and Downstream
Ports between the Root Port and the wakeup-signaling device and
those switch ports may be in D3hot or D3cold. Which means config space
of the wakeup-signaling device is inaccessible. pci_check_pme_status()
happens to be written in such a way that if it reads fabricated
"all ones" responses from the device, it assumes that the device
is signaling wakeup. The final pci_write_config_word() in
pci_check_pme_status() will be lost but there's a call to
pci_enable_wake(pci_dev, PCI_D0, false) upon runtime resume
which makes up for the lost write, so the code happens to work.
Just be aware of pitfalls there...
Thanks,
Lukas
next prev parent reply other threads:[~2026-03-25 5:56 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 22:08 [PATCH v3] PCI: pciehp: Fix hotplug on Catlow Lake with unreliable PME status Kuppuswamy Sathyanarayanan
2026-03-23 12:53 ` Lukas Wunner
2026-03-23 23:24 ` Bjorn Helgaas
2026-03-24 21:45 ` Kuppuswamy Sathyanarayanan
2026-03-24 23:46 ` Bjorn Helgaas
2026-03-25 5:56 ` Lukas Wunner [this message]
2026-03-25 23:21 ` Bjorn Helgaas
2026-03-25 6:11 ` Mika Westerberg
2026-03-25 21:12 ` Kuppuswamy Sathyanarayanan
2026-03-26 6:12 ` Mika Westerberg
2026-03-26 21:23 ` Kuppuswamy Sathyanarayanan
2026-03-27 11:16 ` Mika Westerberg
2026-04-03 19:37 ` Kuppuswamy Sathyanarayanan
2026-04-07 7:08 ` Mika Westerberg
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=acN5HorrB31LLjiJ@wunner.de \
--to=lukas@wunner.de \
--cc=bhelgaas@google.com \
--cc=helgaas@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=rafael@kernel.org \
--cc=sathyanarayanan.kuppuswamy@linux.intel.com \
/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