[PATCH v7 0/3] PCI: Add support for PCIe WAKE# interrupt

Krishna Chaitanya Chundru posted 3 patches 1 month, 4 weeks ago
There is a newer version of this series
drivers/base/power/wakeirq.c  | 39 ++++++++++++++++++++++++++----
drivers/pci/of.c              | 55 +++++++++++++++++++++++++++++++++++++++++++
drivers/pci/pci.c             |  9 +++++++
drivers/pci/pci.h             |  8 +++++++
drivers/pci/probe.c           |  2 ++
drivers/pci/remove.c          |  1 +
include/linux/gpio/consumer.h |  9 +++++++
include/linux/pci.h           |  2 ++
include/linux/pm_wakeirq.h    |  6 +++++
9 files changed, 126 insertions(+), 5 deletions(-)
[PATCH v7 0/3] PCI: Add support for PCIe WAKE# interrupt
Posted by Krishna Chaitanya Chundru 1 month, 4 weeks ago
PCIe WAKE# interrupt is needed for bringing back PCIe device state from
D3cold to D0.

This is pending from long time, there was two attempts done previously to
add WAKE# support[1], [2]. Those series tried to add support for legacy
interrupts along with WAKE#. Legacy interrupts are already available in
the latest kernel and we can ignore them. For the wake IRQ the series is
trying to use interrupts property define in the device tree.

This series is using gpio property instead of interrupts, from
gpio desc driver will allocate the dedicate IRQ.

WAKE# is added in dts schema and merged based on this patch.
https://lore.kernel.org/all/20250515090517.3506772-1-krishna.chundru@oss.qualcomm.com/

[1]: https://lore.kernel.org/all/b2b91240-95fe-145d-502c-d52225497a34@nvidia.com/T/
[2]: https://lore.kernel.org/all/20171226023646.17722-1-jeffy.chen@rock-chips.com/

Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
---
Changes in v7:
- Updated the commit text (Mani).
- Couple of nits like using pci_err instead of dev_err,
  use platform_pci_configure_wake(), platform_pci_remove_wake() instead
  of calling directly calling pci_configure_of_wake_gpio() & pci_remove_of_wake_gpio() etc (Mani).
- Add a new fwnode_gpiod_get() API that wraps fwnode_gpiod_get_index(..0..), similar to
  devm_fwnode_gpiod_get() (Mani).
- Link to v6: https://lore.kernel.org/r/20251127-wakeirq_support-v6-0-60f581f94205@oss.qualcomm.com

Changes in v6:
- Change the name to dev_pm_set_dedicated_shared_wake_irq() and make the
  changes pointed by (Rafael). 
- Link to v5: https://lore.kernel.org/r/20251107-wakeirq_support-v5-0-464e17f2c20c@oss.qualcomm.com

Changes in v5:
- Enable WAKE# irq only when there is wake -gpios defined in its device
  tree node (Bjorn).
- For legacy bindings for direct atach check in root port if we haven't
  find the wake in the endpoint node.
- Instead of hooking wake in driver bound case, do it in the framework
  irrespective of the driver state (Bjorn).
- Link to v4: https://lore.kernel.org/r/20250801-wake_irq_support-v4-0-6b6639013a1a@oss.qualcomm.com

Changes in v4:
- Move wake from portdrv to core framework to endpoint (Bjorn).
- Added support for multiple WAKE# case (Bjorn). But traverse from
  endpoint upstream port to root port till you get WAKE#. And use
  IRQF_SHARED flag for requesting interrupts.
- Link to v3: https://lore.kernel.org/r/20250605-wake_irq_support-v3-0-7ba56dc909a5@oss.qualcomm.com

Changes in v3:
- Update the commit messages, function names etc as suggested by Mani.
- return wake_irq if returns error (Neil).
- Link to v2: https://lore.kernel.org/r/20250419-wake_irq_support-v2-0-06baed9a87a1@oss.qualcomm.com

Changes in v2:
- Move the wake irq teardown after pcie_port_device_remove
  and move of_pci_setup_wake_irq before pcie_link_rcec (Lukas)
- teardown wake irq in shutdown also.
- Link to v1: https://lore.kernel.org/r/20250401-wake_irq_support-v1-0-d2e22f4a0efd@oss.qualcomm.com

---
Krishna Chaitanya Chundru (3):
      PM: sleep: wakeirq: Add support for dedicated shared wake IRQ setup
      gpio: Add fwnode_gpiod_get() helper
      PCI: Add support for PCIe WAKE# interrupt

 drivers/base/power/wakeirq.c  | 39 ++++++++++++++++++++++++++----
 drivers/pci/of.c              | 55 +++++++++++++++++++++++++++++++++++++++++++
 drivers/pci/pci.c             |  9 +++++++
 drivers/pci/pci.h             |  8 +++++++
 drivers/pci/probe.c           |  2 ++
 drivers/pci/remove.c          |  1 +
 include/linux/gpio/consumer.h |  9 +++++++
 include/linux/pci.h           |  2 ++
 include/linux/pm_wakeirq.h    |  6 +++++
 9 files changed, 126 insertions(+), 5 deletions(-)
---
base-commit: cee73b1e840c154f64ace682cb477c1ae2e29cc4
change-id: 20251104-wakeirq_support-f54c4baa18c5

Best regards,
-- 
Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
Re: [PATCH v7 0/3] PCI: Add support for PCIe WAKE# interrupt
Posted by Bartosz Golaszewski 1 month, 4 weeks ago
On Wed, Feb 18, 2026 at 9:12 AM Krishna Chaitanya Chundru
<krishna.chundru@oss.qualcomm.com> wrote:
>
> PCIe WAKE# interrupt is needed for bringing back PCIe device state from
> D3cold to D0.
>
> This is pending from long time, there was two attempts done previously to
> add WAKE# support[1], [2]. Those series tried to add support for legacy
> interrupts along with WAKE#. Legacy interrupts are already available in
> the latest kernel and we can ignore them. For the wake IRQ the series is
> trying to use interrupts property define in the device tree.
>
> This series is using gpio property instead of interrupts, from
> gpio desc driver will allocate the dedicate IRQ.
>
> WAKE# is added in dts schema and merged based on this patch.
> https://lore.kernel.org/all/20250515090517.3506772-1-krishna.chundru@oss.qualcomm.com/
>
> [1]: https://lore.kernel.org/all/b2b91240-95fe-145d-502c-d52225497a34@nvidia.com/T/
> [2]: https://lore.kernel.org/all/20171226023646.17722-1-jeffy.chen@rock-chips.com/
>
> Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
> ---

This spans three subsystems, how do you want to get it upstream?

Bartosz
Re: [PATCH v7 0/3] PCI: Add support for PCIe WAKE# interrupt
Posted by Krishna Chaitanya Chundru 1 month ago

On 2/18/2026 3:31 PM, Bartosz Golaszewski wrote:
> On Wed, Feb 18, 2026 at 9:12 AM Krishna Chaitanya Chundru
> <krishna.chundru@oss.qualcomm.com> wrote:
>> PCIe WAKE# interrupt is needed for bringing back PCIe device state from
>> D3cold to D0.
>>
>> This is pending from long time, there was two attempts done previously to
>> add WAKE# support[1], [2]. Those series tried to add support for legacy
>> interrupts along with WAKE#. Legacy interrupts are already available in
>> the latest kernel and we can ignore them. For the wake IRQ the series is
>> trying to use interrupts property define in the device tree.
>>
>> This series is using gpio property instead of interrupts, from
>> gpio desc driver will allocate the dedicate IRQ.
>>
>> WAKE# is added in dts schema and merged based on this patch.
>> https://lore.kernel.org/all/20250515090517.3506772-1-krishna.chundru@oss.qualcomm.com/
>>
>> [1]: https://lore.kernel.org/all/b2b91240-95fe-145d-502c-d52225497a34@nvidia.com/T/
>> [2]: https://lore.kernel.org/all/20171226023646.17722-1-jeffy.chen@rock-chips.com/
>>
>> Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
>> ---
> This spans three subsystems, how do you want to get it upstream?
Hi Bartosz,
we can take these patches through pci branch, if all maintainers give us 
the ack.

I will mention this info in the next series cover letter.

- Krishna Chaitanya.
>
> Bartosz

Re: [PATCH v7 0/3] PCI: Add support for PCIe WAKE# interrupt
Posted by Chen-Yu Tsai 1 month, 3 weeks ago
On Wed, Feb 18, 2026 at 11:01:23AM +0100, Bartosz Golaszewski wrote:
> On Wed, Feb 18, 2026 at 9:12 AM Krishna Chaitanya Chundru
> <krishna.chundru@oss.qualcomm.com> wrote:
> >
> > PCIe WAKE# interrupt is needed for bringing back PCIe device state from
> > D3cold to D0.
> >
> > This is pending from long time, there was two attempts done previously to
> > add WAKE# support[1], [2]. Those series tried to add support for legacy
> > interrupts along with WAKE#. Legacy interrupts are already available in
> > the latest kernel and we can ignore them. For the wake IRQ the series is
> > trying to use interrupts property define in the device tree.
> >
> > This series is using gpio property instead of interrupts, from
> > gpio desc driver will allocate the dedicate IRQ.
> >
> > WAKE# is added in dts schema and merged based on this patch.
> > https://lore.kernel.org/all/20250515090517.3506772-1-krishna.chundru@oss.qualcomm.com/
> >
> > [1]: https://lore.kernel.org/all/b2b91240-95fe-145d-502c-d52225497a34@nvidia.com/T/
> > [2]: https://lore.kernel.org/all/20171226023646.17722-1-jeffy.chen@rock-chips.com/
> >
> > Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
> > ---
> 
> This spans three subsystems, how do you want to get it upstream?

FWIW, I'm interested in using fwnode_gpiod_get() in the net subsystem
for the same reasons as the author. I could just use
fwnode_gpiod_get_index() and convert later though.


ChenYu


> Bartosz