Re: [PATCH v8 3/3] PCI: Add support for PCIe WAKE# interrupt
From: Manivannan Sadhasivam
Date: Tue Mar 17 2026 - 03:07:43 EST
On Mon, Mar 16, 2026 at 05:46:58PM +0530, Krishna Chaitanya Chundru wrote:
>
>
> On 3/13/2026 7:28 PM, Manivannan Sadhasivam wrote:
> > On Fri, Mar 13, 2026 at 12:38:42PM +0530, Krishna Chaitanya Chundru wrote:
> > > According to the PCI Express specification (PCIe r7.0, Section 5.3.3.2),
> > > two link wakeup mechanisms are defined: Beacon and WAKE#. Beacon is a
> > > hardware-only mechanism and is invisible to software (PCIe r7.0,
> > > Section 4.2.7.8.1). This change adds support for the WAKE# mechanism in
> > > the PCI core.
> > >
> > > According to the PCIe specification, multiple WAKE# signals can exist in
> > > a system or each component in the hierarchy could share a single WAKE#
> > > signal. In configurations involving a PCIe switch, each downstream port
> > > (DSP) of the switch may be connected to a separate WAKE# line, allowing
> > > each endpoint to signal WAKE# independently. From figure 5.4 in sec
> > > 5.3.3.2, WAKE# can also be terminated at the switch itself. To support
> > > this, the WAKE# should be described in the device tree node of the
> > > endpoint/bridge. If all endpoints share a single WAKE# line, then each
> > > endpoint node should describe the same WAKE# signal or a single WAKE# in
> > > the Root Port node.
> > >
> > > In pci_device_add(), PCI framework will search for the WAKE# in device
> > > node, If not found, it searches in its upstream port only if upstream port
> > > is Root Port. Once found, register for the wake IRQ in shared mode, as the
> > > WAKE# may be shared among multiple endpoints.
> > >
> > > dev_pm_set_dedicated_shared_wake_irq() associates a wakeup IRQ with a
> > > device and requests it, but the PM core keeps the IRQ disabled by default.
> > > The IRQ is enabled only when the device is permitted to wake the system,
> > > i.e. during system suspend and after runtime suspend, and only when device
> > > wakeup is enabled.
> > >
> > > When the wake IRQ fires, the wakeirq handler invokes pm_runtime_resume() to
> > > bring the device back to an active power state, such as transitioning from
> > > D3cold to D0. Once the device is active and the link is usable, the
> > > endpoint may generate a PME, which is then handled by the PCI core through
> > > PME polling or the PCIe PME service driver to complete the wakeup of the
> > > endpoint.
> > >
> > > WAKE# is added in dts schema and merged based on below links.
> > >
> > > Link: https://lore.kernel.org/all/20250515090517.3506772-1-krishna.chundru@xxxxxxxxxxxxxxxx/
> > > Link: https://github.com/devicetree-org/dt-schema/pull/170
> > > Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
> > No. Linus never gave this tag for *this* patch.
> Linus gave this on v5 [1], might be a overlook.
>
> [1] Re: [PATCH v5 2/2] PCI: Add support for PCIe WAKE# interrupt - Linus
> Walleij <https://lore.kernel.org/all/CACRpkdY9HsnG=xo=swnMcVha+unmvmxR6e6Ynsj09srM_tPmWA@xxxxxxxxxxxxxx/>
>
Oh yes. I didn't check it properly. Please ignore my comment.
- Mani
--
மணிவண்ணன் சதாசிவம்