public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v7 0/3] PCI: Add support for PCIe WAKE# interrupt
@ 2026-02-18  8:12 Krishna Chaitanya Chundru
  2026-02-18  8:12 ` [PATCH v7 1/3] PM: sleep: wakeirq: Add support for dedicated shared wake IRQ setup Krishna Chaitanya Chundru
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Krishna Chaitanya Chundru @ 2026-02-18  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, Greg Kroah-Hartman,
	Danilo Krummrich, Bjorn Helgaas, Bartosz Golaszewski,
	Linus Walleij, Bartosz Golaszewski, Linus Walleij
  Cc: linux-pm, linux-kernel, linux-pci, linux-gpio, quic_vbadigan,
	quic_mrana, sherry.sun, driver-core, Krishna Chaitanya Chundru

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>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v7 1/3] PM: sleep: wakeirq: Add support for dedicated shared wake IRQ setup
  2026-02-18  8:12 [PATCH v7 0/3] PCI: Add support for PCIe WAKE# interrupt Krishna Chaitanya Chundru
@ 2026-02-18  8:12 ` Krishna Chaitanya Chundru
  2026-02-18  8:12 ` [PATCH v7 2/3] gpio: Add fwnode_gpiod_get() helper Krishna Chaitanya Chundru
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Krishna Chaitanya Chundru @ 2026-02-18  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, Greg Kroah-Hartman,
	Danilo Krummrich, Bjorn Helgaas, Bartosz Golaszewski,
	Linus Walleij, Bartosz Golaszewski, Linus Walleij
  Cc: linux-pm, linux-kernel, linux-pci, linux-gpio, quic_vbadigan,
	quic_mrana, sherry.sun, driver-core, Krishna Chaitanya Chundru

Some devices require more flexibility when configuring their dedicated
wake-up interrupts, such as support for IRQF_SHARED or other IRQ flags.
This is particularly useful in PCIe systems where multiple endpoints
(e.g., Wi-Fi and Bluetooth controllers) share a common WAKE# signal
line which requests platform to re-establish power and reference clocks
to the components. In such cases, drivers can use this new API
dev_pm_set_dedicated_shared_wake_irq() to register a shared wake IRQ.

Update the internal helper __dev_pm_set_dedicated_wake_irq() to accept an
irq_flags argument. Modify the existing dev_pm_set_dedicated_wake_irq()
and dev_pm_set_dedicated_wake_irq_reverse() to preserve current behavior.

When IRQ registered with IRQF_SHARED we can't use IRQF_NO_AUTOEN flag,
so after registering for irq, disable it explicitly.

Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
Acked-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
---
 drivers/base/power/wakeirq.c | 39 ++++++++++++++++++++++++++++++++++-----
 include/linux/pm_wakeirq.h   |  6 ++++++
 2 files changed, 40 insertions(+), 5 deletions(-)

diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c
index c0809d18fc5406b224206e0c8e5028aa8f4183b0..a3ac133496d1aadd31a2a9517322f4ff1c5be7b4 100644
--- a/drivers/base/power/wakeirq.c
+++ b/drivers/base/power/wakeirq.c
@@ -171,7 +171,8 @@ static irqreturn_t handle_threaded_wake_irq(int irq, void *_wirq)
 	return IRQ_HANDLED;
 }
 
-static int __dev_pm_set_dedicated_wake_irq(struct device *dev, int irq, unsigned int flag)
+static int __dev_pm_set_dedicated_wake_irq(struct device *dev, int irq, unsigned int flag,
+					   unsigned int irq_flags)
 {
 	struct wake_irq *wirq;
 	int err;
@@ -200,8 +201,7 @@ static int __dev_pm_set_dedicated_wake_irq(struct device *dev, int irq, unsigned
 	 * so we use a threaded irq.
 	 */
 	err = request_threaded_irq(irq, NULL, handle_threaded_wake_irq,
-				   IRQF_ONESHOT | IRQF_NO_AUTOEN,
-				   wirq->name, wirq);
+				   IRQF_ONESHOT | irq_flags, wirq->name, wirq);
 	if (err)
 		goto err_free_name;
 
@@ -237,7 +237,7 @@ static int __dev_pm_set_dedicated_wake_irq(struct device *dev, int irq, unsigned
  */
 int dev_pm_set_dedicated_wake_irq(struct device *dev, int irq)
 {
-	return __dev_pm_set_dedicated_wake_irq(dev, irq, 0);
+	return __dev_pm_set_dedicated_wake_irq(dev, irq, 0, IRQF_NO_AUTOEN);
 }
 EXPORT_SYMBOL_GPL(dev_pm_set_dedicated_wake_irq);
 
@@ -258,10 +258,39 @@ EXPORT_SYMBOL_GPL(dev_pm_set_dedicated_wake_irq);
  */
 int dev_pm_set_dedicated_wake_irq_reverse(struct device *dev, int irq)
 {
-	return __dev_pm_set_dedicated_wake_irq(dev, irq, WAKE_IRQ_DEDICATED_REVERSE);
+	return __dev_pm_set_dedicated_wake_irq(dev, irq, WAKE_IRQ_DEDICATED_REVERSE,
+					       IRQF_NO_AUTOEN);
 }
 EXPORT_SYMBOL_GPL(dev_pm_set_dedicated_wake_irq_reverse);
 
+/**
+ * dev_pm_set_dedicated_shared_wake_irq - Request a dedicated shared wake-up interrupt
+ * @dev: Device entry
+ * @irq: Device wake-up interrupt
+ * @flags: Custom IRQ flags (e.g., IRQ_TYPE_EDGE_FALLING)
+ *
+ * This API sets up a threaded interrupt handler for a device that has
+ * a shared wake-up interrupt in addition to the device IO interrupt. It also
+ * sets IRQ flags like IRQ_TYPE_EDGE_FALLING passed by the caller.
+ *
+ * Returns 0 on success or a negative error code on failure.
+ */
+int dev_pm_set_dedicated_shared_wake_irq(struct device *dev, int irq, unsigned long flags)
+{
+	struct wake_irq *wirq;
+	int ret;
+
+	ret =  __dev_pm_set_dedicated_wake_irq(dev, irq, 0, IRQF_SHARED | flags);
+	if (ret)
+		return ret;
+
+	wirq = dev->power.wakeirq;
+	disable_irq_nosync(wirq->irq);
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(dev_pm_set_dedicated_shared_wake_irq);
+
 /**
  * dev_pm_enable_wake_irq_check - Checks and enables wake-up interrupt
  * @dev: Device
diff --git a/include/linux/pm_wakeirq.h b/include/linux/pm_wakeirq.h
index 25b63ed51b765c2c6919f259668a12675330835e..61f1e840745b56baa57db37563e450cb2d757a85 100644
--- a/include/linux/pm_wakeirq.h
+++ b/include/linux/pm_wakeirq.h
@@ -11,6 +11,7 @@ extern int dev_pm_set_dedicated_wake_irq(struct device *dev, int irq);
 extern int dev_pm_set_dedicated_wake_irq_reverse(struct device *dev, int irq);
 extern void dev_pm_clear_wake_irq(struct device *dev);
 extern int devm_pm_set_wake_irq(struct device *dev, int irq);
+extern int dev_pm_set_dedicated_shared_wake_irq(struct device *dev, int irq, unsigned long flags);
 
 #else	/* !CONFIG_PM */
 
@@ -38,5 +39,10 @@ static inline int devm_pm_set_wake_irq(struct device *dev, int irq)
 	return 0;
 }
 
+static inline int dev_pm_set_dedicated_shared_wake_irq(struct device *dev,
+						       int irq, unsigned long flags)
+{
+	return 0;
+}
 #endif	/* CONFIG_PM */
 #endif	/* _LINUX_PM_WAKEIRQ_H */

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v7 2/3] gpio: Add fwnode_gpiod_get() helper
  2026-02-18  8:12 [PATCH v7 0/3] PCI: Add support for PCIe WAKE# interrupt Krishna Chaitanya Chundru
  2026-02-18  8:12 ` [PATCH v7 1/3] PM: sleep: wakeirq: Add support for dedicated shared wake IRQ setup Krishna Chaitanya Chundru
@ 2026-02-18  8:12 ` Krishna Chaitanya Chundru
  2026-02-19 17:45   ` Linus Walleij
  2026-02-23 12:53   ` Manivannan Sadhasivam
  2026-02-18  8:12 ` [PATCH v7 3/3] PCI: Add support for PCIe WAKE# interrupt Krishna Chaitanya Chundru
  2026-02-18 10:01 ` [PATCH v7 0/3] " Bartosz Golaszewski
  3 siblings, 2 replies; 13+ messages in thread
From: Krishna Chaitanya Chundru @ 2026-02-18  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, Greg Kroah-Hartman,
	Danilo Krummrich, Bjorn Helgaas, Bartosz Golaszewski,
	Linus Walleij, Bartosz Golaszewski, Linus Walleij
  Cc: linux-pm, linux-kernel, linux-pci, linux-gpio, quic_vbadigan,
	quic_mrana, sherry.sun, driver-core, Krishna Chaitanya Chundru

Add fwnode_gpiod_get() as a convenience wrapper around
fwnode_gpiod_get_index() for the common case where only the
first GPIO is required.

This mirrors existing gpiod_get() and devm_gpiod_get() helpers
and avoids open-coding index 0 at call sites.

Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
---
 include/linux/gpio/consumer.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index 0d8408582918680bfea6a04ccedfc0c75211907a..fee926c0262ce9dc4b9a3c151e74f2cf37470a49 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -596,6 +596,15 @@ static inline int gpiod_disable_hw_timestamp_ns(struct gpio_desc *desc,
 }
 #endif /* CONFIG_GPIOLIB && CONFIG_HTE */
 
+static inline
+struct gpio_desc *fwnode_gpiod_get(struct fwnode_handle *fwnode,
+				   const char *con_id,
+				   enum gpiod_flags flags,
+				   const char *label)
+{
+	return fwnode_gpiod_get_index(fwnode, con_id, 0, flags, label);
+}
+
 static inline
 struct gpio_desc *devm_fwnode_gpiod_get(struct device *dev,
 					struct fwnode_handle *fwnode,

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v7 3/3] PCI: Add support for PCIe WAKE# interrupt
  2026-02-18  8:12 [PATCH v7 0/3] PCI: Add support for PCIe WAKE# interrupt Krishna Chaitanya Chundru
  2026-02-18  8:12 ` [PATCH v7 1/3] PM: sleep: wakeirq: Add support for dedicated shared wake IRQ setup Krishna Chaitanya Chundru
  2026-02-18  8:12 ` [PATCH v7 2/3] gpio: Add fwnode_gpiod_get() helper Krishna Chaitanya Chundru
@ 2026-02-18  8:12 ` Krishna Chaitanya Chundru
  2026-02-18 13:49   ` kernel test robot
                     ` (2 more replies)
  2026-02-18 10:01 ` [PATCH v7 0/3] " Bartosz Golaszewski
  3 siblings, 3 replies; 13+ messages in thread
From: Krishna Chaitanya Chundru @ 2026-02-18  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, Greg Kroah-Hartman,
	Danilo Krummrich, Bjorn Helgaas, Bartosz Golaszewski,
	Linus Walleij, Bartosz Golaszewski, Linus Walleij
  Cc: linux-pm, linux-kernel, linux-pci, linux-gpio, quic_vbadigan,
	quic_mrana, sherry.sun, driver-core, Krishna Chaitanya Chundru

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.

When a device asserts WAKE#, PM core will wakeup the system, resume the
device and its parent(s) in the hierarchy, which will cause the restoration
of power and refclk to the device.

WAKE# is added in dts schema and merged based on below links.

Link: https://lore.kernel.org/all/20250515090517.3506772-1-krishna.chundru@oss.qualcomm.com/
Link: https://github.com/devicetree-org/dt-schema/pull/170
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
---
 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/pci.h  |  2 ++
 6 files changed, 77 insertions(+)

diff --git a/drivers/pci/of.c b/drivers/pci/of.c
index 9bb5f258759be3f1e23496f083353600a4ef6743..23248900253faafaf9509d87c531b454fca41798 100644
--- a/drivers/pci/of.c
+++ b/drivers/pci/of.c
@@ -7,6 +7,7 @@
 #define pr_fmt(fmt)	"PCI: OF: " fmt
 
 #include <linux/cleanup.h>
+#include <linux/gpio/consumer.h>
 #include <linux/irqdomain.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
@@ -15,6 +16,7 @@
 #include <linux/of_address.h>
 #include <linux/of_pci.h>
 #include <linux/platform_device.h>
+#include <linux/pm_wakeirq.h>
 #include "pci.h"
 
 #ifdef CONFIG_PCI
@@ -586,6 +588,59 @@ int of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin)
 	return irq_create_of_mapping(&oirq);
 }
 EXPORT_SYMBOL_GPL(of_irq_parse_and_map_pci);
+
+static void pci_configure_wake_irq(struct pci_dev *pdev, struct gpio_desc *wake)
+{
+	int ret, wake_irq;
+
+	wake_irq = gpiod_to_irq(wake);
+	if (wake_irq < 0) {
+		pci_err(pdev, "Failed to get wake irq: %d\n", wake_irq);
+		return;
+	}
+
+	device_init_wakeup(&pdev->dev, true);
+
+	ret = dev_pm_set_dedicated_shared_wake_irq(&pdev->dev, wake_irq,
+						   IRQ_TYPE_EDGE_FALLING);
+	if (ret < 0) {
+		pci_err(pdev, "Failed to set wake IRQ: %d\n", ret);
+		device_init_wakeup(&pdev->dev, false);
+	}
+}
+
+void pci_configure_of_wake_gpio(struct pci_dev *dev)
+{
+	struct device_node *dn = pci_device_to_OF_node(dev);
+	struct pci_dev *upstream;
+	struct gpio_desc *gpio;
+
+	if (!dn)
+		return;
+
+	gpio = fwnode_gpiod_get(of_fwnode_handle(dn), "wake",
+				GPIOD_IN | GPIOD_FLAGS_BIT_NONEXCLUSIVE, NULL);
+	if (IS_ERR(gpio)) {
+		/*
+		 * In case the entire topology shares a single WAKE# signal, look for it
+		 * in the upstream bridge node. But if it is not Root Port, then skip it.
+		 */
+		upstream = pci_upstream_bridge(dev);
+		if (upstream && pci_is_root_bus(upstream->bus) && upstream->wake)
+			pci_configure_wake_irq(dev, upstream->wake);
+	} else {
+		dev->wake = gpio;
+		pci_configure_wake_irq(dev, gpio);
+	}
+}
+
+void pci_remove_of_wake_gpio(struct pci_dev *dev)
+{
+	dev_pm_clear_wake_irq(&dev->dev);
+	device_init_wakeup(&dev->dev, false);
+	gpiod_put(dev->wake);
+	dev->wake = NULL;
+}
 #endif	/* CONFIG_OF_IRQ */
 
 static int pci_parse_request_of_pci_ranges(struct device *dev,
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index f3244630bfd05b15d52f866d80a015ed21f98f49..225cb861b3425700fc0d9d4805f5d9efcaab6f56 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1123,6 +1123,15 @@ static inline bool platform_pci_bridge_d3(struct pci_dev *dev)
 	return acpi_pci_bridge_d3(dev);
 }
 
+void platform_pci_configure_wake(struct pci_dev *dev)
+{
+	return pci_configure_of_wake_gpio(dev);
+}
+
+void platform_pci_remove_wake(struct pci_dev *dev)
+{
+	return pci_remove_of_wake_gpio(dev);
+}
 /**
  * pci_update_current_state - Read power state of given device and cache it
  * @dev: PCI device to handle.
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 13d998fbacce6698514d92500dfea03cc562cdc2..22709573e41caf0ed45b20ee7ded5963f55aa9fe 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -282,6 +282,8 @@ void pci_msix_init(struct pci_dev *dev);
 bool pci_bridge_d3_possible(struct pci_dev *dev);
 void pci_bridge_d3_update(struct pci_dev *dev);
 int pci_bridge_wait_for_secondary_bus(struct pci_dev *dev, char *reset_type);
+void platform_pci_configure_wake(struct pci_dev *dev);
+void platform_pci_remove_wake(struct pci_dev *dev);
 
 static inline bool pci_bus_rrs_vendor_id(u32 l)
 {
@@ -1195,6 +1197,9 @@ void pci_release_of_node(struct pci_dev *dev);
 void pci_set_bus_of_node(struct pci_bus *bus);
 void pci_release_bus_of_node(struct pci_bus *bus);
 
+void pci_configure_of_wake_gpio(struct pci_dev *dev);
+void pci_remove_of_wake_gpio(struct pci_dev *dev);
+
 int devm_of_pci_bridge_init(struct device *dev, struct pci_host_bridge *bridge);
 bool of_pci_supply_present(struct device_node *np);
 int of_pci_get_equalization_presets(struct device *dev,
@@ -1240,6 +1245,9 @@ static inline int devm_of_pci_bridge_init(struct device *dev, struct pci_host_br
 	return 0;
 }
 
+static inline void pci_configure_of_wake_gpio(struct pci_dev *dev) { }
+static inline void pci_remove_of_wake_gpio(struct pci_dev *dev) { }
+
 static inline bool of_pci_supply_present(struct device_node *np)
 {
 	return false;
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 2975974f35e88b5025701d2b721df8386419de8d..7f5132c0c8de36a6ec2775468a3d4e5156a046d0 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -2771,6 +2771,8 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
 	/* Establish pdev->tsm for newly added (e.g. new SR-IOV VFs) */
 	pci_tsm_init(dev);
 
+	platform_pci_configure_wake(dev);
+
 	pci_npem_create(dev);
 
 	pci_doe_sysfs_init(dev);
diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c
index e9d519993853f92f1810d3eff9f44ca7e3e1abd9..d781b41e57c4444077075690cec926a9fe15334f 100644
--- a/drivers/pci/remove.c
+++ b/drivers/pci/remove.c
@@ -35,6 +35,7 @@ static void pci_destroy_dev(struct pci_dev *dev)
 	if (pci_dev_test_and_set_removed(dev))
 		return;
 
+	platform_pci_remove_wake(dev);
 	pci_doe_sysfs_teardown(dev);
 	pci_npem_remove(dev);
 
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 1c270f1d512301de4d462fe7e5097c32af5c6f8d..d1e08df8a8deaa87780589f23242767fdcdba541 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -586,6 +586,8 @@ struct pci_dev {
 	/* These methods index pci_reset_fn_methods[] */
 	u8 reset_methods[PCI_NUM_RESET_METHODS]; /* In priority order */
 
+	struct gpio_desc *wake; /* Holds WAKE# gpio */
+
 #ifdef CONFIG_PCIE_TPH
 	u16		tph_cap;	/* TPH capability offset */
 	u8		tph_mode;	/* TPH mode */

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v7 0/3] PCI: Add support for PCIe WAKE# interrupt
  2026-02-18  8:12 [PATCH v7 0/3] PCI: Add support for PCIe WAKE# interrupt Krishna Chaitanya Chundru
                   ` (2 preceding siblings ...)
  2026-02-18  8:12 ` [PATCH v7 3/3] PCI: Add support for PCIe WAKE# interrupt Krishna Chaitanya Chundru
@ 2026-02-18 10:01 ` Bartosz Golaszewski
  2026-02-24  8:13   ` Chen-Yu Tsai
  2026-03-13  7:03   ` Krishna Chaitanya Chundru
  3 siblings, 2 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2026-02-18 10:01 UTC (permalink / raw)
  To: Krishna Chaitanya Chundru
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, Greg Kroah-Hartman,
	Danilo Krummrich, Bjorn Helgaas, Linus Walleij, linux-pm,
	linux-kernel, linux-pci, linux-gpio, quic_vbadigan, quic_mrana,
	sherry.sun, driver-core

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v7 3/3] PCI: Add support for PCIe WAKE# interrupt
  2026-02-18  8:12 ` [PATCH v7 3/3] PCI: Add support for PCIe WAKE# interrupt Krishna Chaitanya Chundru
@ 2026-02-18 13:49   ` kernel test robot
  2026-02-18 16:58   ` kernel test robot
  2026-02-23 14:07   ` Manivannan Sadhasivam
  2 siblings, 0 replies; 13+ messages in thread
From: kernel test robot @ 2026-02-18 13:49 UTC (permalink / raw)
  To: Krishna Chaitanya Chundru, Rafael J. Wysocki, Len Brown,
	Pavel Machek, Greg Kroah-Hartman, Danilo Krummrich, Bjorn Helgaas,
	Bartosz Golaszewski, Linus Walleij
  Cc: oe-kbuild-all, linux-pm, linux-kernel, linux-pci, linux-gpio,
	quic_vbadigan, quic_mrana, sherry.sun, driver-core,
	Krishna Chaitanya Chundru

Hi Krishna,

kernel test robot noticed the following build errors:

[auto build test ERROR on cee73b1e840c154f64ace682cb477c1ae2e29cc4]

url:    https://github.com/intel-lab-lkp/linux/commits/Krishna-Chaitanya-Chundru/PM-sleep-wakeirq-Add-support-for-dedicated-shared-wake-IRQ-setup/20260218-162247
base:   cee73b1e840c154f64ace682cb477c1ae2e29cc4
patch link:    https://lore.kernel.org/r/20260218-wakeirq_support-v7-3-0d4689830207%40oss.qualcomm.com
patch subject: [PATCH v7 3/3] PCI: Add support for PCIe WAKE# interrupt
config: sparc-randconfig-001-20260218 (https://download.01.org/0day-ci/archive/20260218/202602182100.CSUJWXc8-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 14.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260218/202602182100.CSUJWXc8-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602182100.CSUJWXc8-lkp@intel.com/

All errors (new ones prefixed by >>):

   sparc64-linux-ld: drivers/pci/pci.o: in function `platform_pci_configure_wake':
>> pci.c:(.text+0x5d0c): undefined reference to `pci_configure_of_wake_gpio'
   sparc64-linux-ld: drivers/pci/pci.o: in function `platform_pci_remove_wake':
>> pci.c:(.text+0x5d4c): undefined reference to `pci_remove_of_wake_gpio'
   sparc64-linux-ld: drivers/pci/endpoint/functions/pci-epf-test.o: in function `pci_epf_test_add_cfs':
   pci-epf-test.c:(.text+0xec): undefined reference to `config_group_init_type_name'

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v7 3/3] PCI: Add support for PCIe WAKE# interrupt
  2026-02-18  8:12 ` [PATCH v7 3/3] PCI: Add support for PCIe WAKE# interrupt Krishna Chaitanya Chundru
  2026-02-18 13:49   ` kernel test robot
@ 2026-02-18 16:58   ` kernel test robot
  2026-02-23 14:07   ` Manivannan Sadhasivam
  2 siblings, 0 replies; 13+ messages in thread
From: kernel test robot @ 2026-02-18 16:58 UTC (permalink / raw)
  To: Krishna Chaitanya Chundru, Rafael J. Wysocki, Len Brown,
	Pavel Machek, Greg Kroah-Hartman, Danilo Krummrich, Bjorn Helgaas,
	Bartosz Golaszewski, Linus Walleij
  Cc: oe-kbuild-all, linux-pm, linux-kernel, linux-pci, linux-gpio,
	quic_vbadigan, quic_mrana, sherry.sun, driver-core,
	Krishna Chaitanya Chundru

Hi Krishna,

kernel test robot noticed the following build errors:

[auto build test ERROR on cee73b1e840c154f64ace682cb477c1ae2e29cc4]

url:    https://github.com/intel-lab-lkp/linux/commits/Krishna-Chaitanya-Chundru/PM-sleep-wakeirq-Add-support-for-dedicated-shared-wake-IRQ-setup/20260218-162247
base:   cee73b1e840c154f64ace682cb477c1ae2e29cc4
patch link:    https://lore.kernel.org/r/20260218-wakeirq_support-v7-3-0d4689830207%40oss.qualcomm.com
patch subject: [PATCH v7 3/3] PCI: Add support for PCIe WAKE# interrupt
config: sparc64-randconfig-002-20260218 (https://download.01.org/0day-ci/archive/20260219/202602190038.BHg9UcM5-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 12.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260219/202602190038.BHg9UcM5-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602190038.BHg9UcM5-lkp@intel.com/

All errors (new ones prefixed by >>):

   sparc64-linux-ld: drivers/pci/pci.o: in function `platform_pci_configure_wake':
>> drivers/pci/pci.c:1128:(.text+0x39c8): undefined reference to `pci_configure_of_wake_gpio'
   sparc64-linux-ld: drivers/pci/pci.o: in function `platform_pci_remove_wake':
>> drivers/pci/pci.c:1133:(.text+0x39d4): undefined reference to `pci_remove_of_wake_gpio'


vim +1128 drivers/pci/pci.c

  1125	
  1126	void platform_pci_configure_wake(struct pci_dev *dev)
  1127	{
> 1128		return pci_configure_of_wake_gpio(dev);
  1129	}
  1130	
  1131	void platform_pci_remove_wake(struct pci_dev *dev)
  1132	{
> 1133		return pci_remove_of_wake_gpio(dev);
  1134	}
  1135	/**
  1136	 * pci_update_current_state - Read power state of given device and cache it
  1137	 * @dev: PCI device to handle.
  1138	 * @state: State to cache in case the device doesn't have the PM capability
  1139	 *
  1140	 * The power state is read from the PMCSR register, which however is
  1141	 * inaccessible in D3cold.  The platform firmware is therefore queried first
  1142	 * to detect accessibility of the register.  In case the platform firmware
  1143	 * reports an incorrect state or the device isn't power manageable by the
  1144	 * platform at all, we try to detect D3cold by testing accessibility of the
  1145	 * vendor ID in config space.
  1146	 */
  1147	void pci_update_current_state(struct pci_dev *dev, pci_power_t state)
  1148	{
  1149		if (platform_pci_get_power_state(dev) == PCI_D3cold) {
  1150			dev->current_state = PCI_D3cold;
  1151		} else if (dev->pm_cap) {
  1152			u16 pmcsr;
  1153	
  1154			pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr);
  1155			if (PCI_POSSIBLE_ERROR(pmcsr)) {
  1156				dev->current_state = PCI_D3cold;
  1157				return;
  1158			}
  1159			dev->current_state = pmcsr & PCI_PM_CTRL_STATE_MASK;
  1160		} else {
  1161			dev->current_state = state;
  1162		}
  1163	}
  1164	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v7 2/3] gpio: Add fwnode_gpiod_get() helper
  2026-02-18  8:12 ` [PATCH v7 2/3] gpio: Add fwnode_gpiod_get() helper Krishna Chaitanya Chundru
@ 2026-02-19 17:45   ` Linus Walleij
  2026-02-23 12:53   ` Manivannan Sadhasivam
  1 sibling, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2026-02-19 17:45 UTC (permalink / raw)
  To: Krishna Chaitanya Chundru
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, Greg Kroah-Hartman,
	Danilo Krummrich, Bjorn Helgaas, Bartosz Golaszewski,
	Bartosz Golaszewski, linux-pm, linux-kernel, linux-pci,
	linux-gpio, quic_vbadigan, quic_mrana, sherry.sun, driver-core

On Wed, Feb 18, 2026 at 9:12 AM Krishna Chaitanya Chundru
<krishna.chundru@oss.qualcomm.com> wrote:

> Add fwnode_gpiod_get() as a convenience wrapper around
> fwnode_gpiod_get_index() for the common case where only the
> first GPIO is required.
>
> This mirrors existing gpiod_get() and devm_gpiod_get() helpers
> and avoids open-coding index 0 at call sites.
>
> Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>

Looks helpful.
Reviewed-by: Linus Walleij <linusw@kernel.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v7 2/3] gpio: Add fwnode_gpiod_get() helper
  2026-02-18  8:12 ` [PATCH v7 2/3] gpio: Add fwnode_gpiod_get() helper Krishna Chaitanya Chundru
  2026-02-19 17:45   ` Linus Walleij
@ 2026-02-23 12:53   ` Manivannan Sadhasivam
  1 sibling, 0 replies; 13+ messages in thread
From: Manivannan Sadhasivam @ 2026-02-23 12:53 UTC (permalink / raw)
  To: Krishna Chaitanya Chundru
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, Greg Kroah-Hartman,
	Danilo Krummrich, Bjorn Helgaas, Bartosz Golaszewski,
	Linus Walleij, Bartosz Golaszewski, linux-pm, linux-kernel,
	linux-pci, linux-gpio, quic_vbadigan, quic_mrana, sherry.sun,
	driver-core

On Wed, Feb 18, 2026 at 01:42:24PM +0530, Krishna Chaitanya Chundru wrote:
> Add fwnode_gpiod_get() as a convenience wrapper around
> fwnode_gpiod_get_index() for the common case where only the
> first GPIO is required.
> 
> This mirrors existing gpiod_get() and devm_gpiod_get() helpers
> and avoids open-coding index 0 at call sites.
> 
> Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>

Suggested-by: Manivannan Sadhasivam <mani@kernel.org>
Acked-by: Manivannan Sadhasivam <mani@kernel.org>

- Mani

> ---
>  include/linux/gpio/consumer.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
> index 0d8408582918680bfea6a04ccedfc0c75211907a..fee926c0262ce9dc4b9a3c151e74f2cf37470a49 100644
> --- a/include/linux/gpio/consumer.h
> +++ b/include/linux/gpio/consumer.h
> @@ -596,6 +596,15 @@ static inline int gpiod_disable_hw_timestamp_ns(struct gpio_desc *desc,
>  }
>  #endif /* CONFIG_GPIOLIB && CONFIG_HTE */
>  
> +static inline
> +struct gpio_desc *fwnode_gpiod_get(struct fwnode_handle *fwnode,
> +				   const char *con_id,
> +				   enum gpiod_flags flags,
> +				   const char *label)
> +{
> +	return fwnode_gpiod_get_index(fwnode, con_id, 0, flags, label);
> +}
> +
>  static inline
>  struct gpio_desc *devm_fwnode_gpiod_get(struct device *dev,
>  					struct fwnode_handle *fwnode,
> 
> -- 
> 2.34.1
> 
> 

-- 
மணிவண்ணன் சதாசிவம்

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v7 3/3] PCI: Add support for PCIe WAKE# interrupt
  2026-02-18  8:12 ` [PATCH v7 3/3] PCI: Add support for PCIe WAKE# interrupt Krishna Chaitanya Chundru
  2026-02-18 13:49   ` kernel test robot
  2026-02-18 16:58   ` kernel test robot
@ 2026-02-23 14:07   ` Manivannan Sadhasivam
  2026-02-25 12:32     ` Krishna Chaitanya Chundru
  2 siblings, 1 reply; 13+ messages in thread
From: Manivannan Sadhasivam @ 2026-02-23 14:07 UTC (permalink / raw)
  To: Krishna Chaitanya Chundru
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, Greg Kroah-Hartman,
	Danilo Krummrich, Bjorn Helgaas, Bartosz Golaszewski,
	Linus Walleij, Bartosz Golaszewski, linux-pm, linux-kernel,
	linux-pci, linux-gpio, quic_vbadigan, quic_mrana, sherry.sun,
	driver-core

On Wed, Feb 18, 2026 at 01:42:25PM +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.
> 
> When a device asserts WAKE#, PM core will wakeup the system, resume the
> device and its parent(s) in the hierarchy, which will cause the restoration
> of power and refclk to the device.
> 
> WAKE# is added in dts schema and merged based on below links.
> 
> Link: https://lore.kernel.org/all/20250515090517.3506772-1-krishna.chundru@oss.qualcomm.com/
> Link: https://github.com/devicetree-org/dt-schema/pull/170
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
> ---
>  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/pci.h  |  2 ++
>  6 files changed, 77 insertions(+)
> 
> diff --git a/drivers/pci/of.c b/drivers/pci/of.c
> index 9bb5f258759be3f1e23496f083353600a4ef6743..23248900253faafaf9509d87c531b454fca41798 100644
> --- a/drivers/pci/of.c
> +++ b/drivers/pci/of.c
> @@ -7,6 +7,7 @@
>  #define pr_fmt(fmt)	"PCI: OF: " fmt
>  
>  #include <linux/cleanup.h>
> +#include <linux/gpio/consumer.h>
>  #include <linux/irqdomain.h>
>  #include <linux/kernel.h>
>  #include <linux/pci.h>
> @@ -15,6 +16,7 @@
>  #include <linux/of_address.h>
>  #include <linux/of_pci.h>
>  #include <linux/platform_device.h>
> +#include <linux/pm_wakeirq.h>
>  #include "pci.h"
>  
>  #ifdef CONFIG_PCI
> @@ -586,6 +588,59 @@ int of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin)
>  	return irq_create_of_mapping(&oirq);
>  }
>  EXPORT_SYMBOL_GPL(of_irq_parse_and_map_pci);
> +
> +static void pci_configure_wake_irq(struct pci_dev *pdev, struct gpio_desc *wake)
> +{
> +	int ret, wake_irq;
> +
> +	wake_irq = gpiod_to_irq(wake);
> +	if (wake_irq < 0) {
> +		pci_err(pdev, "Failed to get wake irq: %d\n", wake_irq);
> +		return;
> +	}
> +
> +	device_init_wakeup(&pdev->dev, true);
> +
> +	ret = dev_pm_set_dedicated_shared_wake_irq(&pdev->dev, wake_irq,
> +						   IRQ_TYPE_EDGE_FALLING);
> +	if (ret < 0) {
> +		pci_err(pdev, "Failed to set wake IRQ: %d\n", ret);
> +		device_init_wakeup(&pdev->dev, false);
> +	}
> +}
> +
> +void pci_configure_of_wake_gpio(struct pci_dev *dev)
> +{
> +	struct device_node *dn = pci_device_to_OF_node(dev);
> +	struct pci_dev *upstream;
> +	struct gpio_desc *gpio;
> +
> +	if (!dn)
> +		return;
> +
> +	gpio = fwnode_gpiod_get(of_fwnode_handle(dn), "wake",
> +				GPIOD_IN | GPIOD_FLAGS_BIT_NONEXCLUSIVE, NULL);
> +	if (IS_ERR(gpio)) {
> +		/*
> +		 * In case the entire topology shares a single WAKE# signal, look for it
> +		 * in the upstream bridge node. But if it is not Root Port, then skip it.
> +		 */

This comment need to be a bit more verbose. Something like,

"The devices in a hierarchy expose wakeup capability through the 'wake-gpios'
property defined either in the device node or in the Slot node. So first check
for the property in device node and if not available, check in the Slot node."

Also, move it above fwnode_gpiod_get().

> +		upstream = pci_upstream_bridge(dev);
> +		if (upstream && pci_is_root_bus(upstream->bus) && upstream->wake)

Check directly in the Root Port (Slot) node.

> +			pci_configure_wake_irq(dev, upstream->wake);

I don't think we need to request an IRQ in the fallback case. Let's assume that
there is a single device in hierarchy and the wake-gpios property is defined in
the Slot node. So here, we should just let the PCI/PM core know that this device
supports wakeup and PME_EN needs to be set (if the device is also capable of
generating PME#).

And then we should call pci_configure_wake_irq() from platform_pci_set_wakeup()
to setup the IRQ handler only for the device which has the wake-gpios property.

So the flow would be:

pci_device_add()->platform_pci_init_wakeup()->of_pci_init_wakeup():
Request fwnode_gpiod_get() and call device_init_wakeup()
and set 'dev->wake' if WAKE# is available in the device node. If not, then check
the Root Port (Slot) node and if WAKE# is available, then just call
device_init_wakeup() to indicate the PCI and PM cores that this device *may*
support wakeup.

pci_enable_wake()->platform_pci_set_wakeup()->of_pci_set_wakeup():
Request WAKE# IRQ only if the device has the wake-gpios property ie., dev->wake
set. If only the Slot supports wakeup, then the IRQ should be requested for the
Root Port device. This will allow us to keep both the ACPI and OF platform code
in sync to some extent.

Then once the WAKE# is asserted, the platform will wakeup with the help of the
above wakeup event and the host controller driver will apply power to the
hierarchy.

But you do not seem to call pci_pme_wakeup_bus() after resume...

> +	} else {
> +		dev->wake = gpio;
> +		pci_configure_wake_irq(dev, gpio);
> +	}
> +}
> +
> +void pci_remove_of_wake_gpio(struct pci_dev *dev)
> +{

Missing of_node check.

> +	dev_pm_clear_wake_irq(&dev->dev);
> +	device_init_wakeup(&dev->dev, false);
> +	gpiod_put(dev->wake);
> +	dev->wake = NULL;
> +}
>  #endif	/* CONFIG_OF_IRQ */
>  
>  static int pci_parse_request_of_pci_ranges(struct device *dev,
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index f3244630bfd05b15d52f866d80a015ed21f98f49..225cb861b3425700fc0d9d4805f5d9efcaab6f56 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -1123,6 +1123,15 @@ static inline bool platform_pci_bridge_d3(struct pci_dev *dev)
>  	return acpi_pci_bridge_d3(dev);
>  }
>  
> +void platform_pci_configure_wake(struct pci_dev *dev)
> +{
> +	return pci_configure_of_wake_gpio(dev);
> +}
> +
> +void platform_pci_remove_wake(struct pci_dev *dev)
> +{
> +	return pci_remove_of_wake_gpio(dev);
> +}

As mentioned above, these should go away and be part of
platform_pci_set_wakeup().

>  /**
>   * pci_update_current_state - Read power state of given device and cache it
>   * @dev: PCI device to handle.
> diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
> index 13d998fbacce6698514d92500dfea03cc562cdc2..22709573e41caf0ed45b20ee7ded5963f55aa9fe 100644
> --- a/drivers/pci/pci.h
> +++ b/drivers/pci/pci.h
> @@ -282,6 +282,8 @@ void pci_msix_init(struct pci_dev *dev);
>  bool pci_bridge_d3_possible(struct pci_dev *dev);
>  void pci_bridge_d3_update(struct pci_dev *dev);
>  int pci_bridge_wait_for_secondary_bus(struct pci_dev *dev, char *reset_type);
> +void platform_pci_configure_wake(struct pci_dev *dev);
> +void platform_pci_remove_wake(struct pci_dev *dev);
>  
>  static inline bool pci_bus_rrs_vendor_id(u32 l)
>  {
> @@ -1195,6 +1197,9 @@ void pci_release_of_node(struct pci_dev *dev);
>  void pci_set_bus_of_node(struct pci_bus *bus);
>  void pci_release_bus_of_node(struct pci_bus *bus);
>  
> +void pci_configure_of_wake_gpio(struct pci_dev *dev);
> +void pci_remove_of_wake_gpio(struct pci_dev *dev);
> +
>  int devm_of_pci_bridge_init(struct device *dev, struct pci_host_bridge *bridge);
>  bool of_pci_supply_present(struct device_node *np);
>  int of_pci_get_equalization_presets(struct device *dev,
> @@ -1240,6 +1245,9 @@ static inline int devm_of_pci_bridge_init(struct device *dev, struct pci_host_br
>  	return 0;
>  }
>  
> +static inline void pci_configure_of_wake_gpio(struct pci_dev *dev) { }
> +static inline void pci_remove_of_wake_gpio(struct pci_dev *dev) { }
> +

You've added function definitions under CONFIG_OF_IRQ, but stubs under
CONFIG_OF. This is why kernel robot also barks at you.

Move the stubs to include/linux/of_pci.h under CONFIG_OF_IRQ guard.

- Mani

>  static inline bool of_pci_supply_present(struct device_node *np)
>  {
>  	return false;
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 2975974f35e88b5025701d2b721df8386419de8d..7f5132c0c8de36a6ec2775468a3d4e5156a046d0 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -2771,6 +2771,8 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
>  	/* Establish pdev->tsm for newly added (e.g. new SR-IOV VFs) */
>  	pci_tsm_init(dev);
>  
> +	platform_pci_configure_wake(dev);
> +
>  	pci_npem_create(dev);
>  
>  	pci_doe_sysfs_init(dev);
> diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c
> index e9d519993853f92f1810d3eff9f44ca7e3e1abd9..d781b41e57c4444077075690cec926a9fe15334f 100644
> --- a/drivers/pci/remove.c
> +++ b/drivers/pci/remove.c
> @@ -35,6 +35,7 @@ static void pci_destroy_dev(struct pci_dev *dev)
>  	if (pci_dev_test_and_set_removed(dev))
>  		return;
>  
> +	platform_pci_remove_wake(dev);
>  	pci_doe_sysfs_teardown(dev);
>  	pci_npem_remove(dev);
>  
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 1c270f1d512301de4d462fe7e5097c32af5c6f8d..d1e08df8a8deaa87780589f23242767fdcdba541 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -586,6 +586,8 @@ struct pci_dev {
>  	/* These methods index pci_reset_fn_methods[] */
>  	u8 reset_methods[PCI_NUM_RESET_METHODS]; /* In priority order */
>  
> +	struct gpio_desc *wake; /* Holds WAKE# gpio */
> +
>  #ifdef CONFIG_PCIE_TPH
>  	u16		tph_cap;	/* TPH capability offset */
>  	u8		tph_mode;	/* TPH mode */
> 
> -- 
> 2.34.1
> 
> 

-- 
மணிவண்ணன் சதாசிவம்

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v7 0/3] PCI: Add support for PCIe WAKE# interrupt
  2026-02-18 10:01 ` [PATCH v7 0/3] " Bartosz Golaszewski
@ 2026-02-24  8:13   ` Chen-Yu Tsai
  2026-03-13  7:03   ` Krishna Chaitanya Chundru
  1 sibling, 0 replies; 13+ messages in thread
From: Chen-Yu Tsai @ 2026-02-24  8:13 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Krishna Chaitanya Chundru, Rafael J. Wysocki, Len Brown,
	Pavel Machek, Greg Kroah-Hartman, Danilo Krummrich, Bjorn Helgaas,
	Linus Walleij, linux-pm, linux-kernel, linux-pci, linux-gpio,
	quic_vbadigan, quic_mrana, sherry.sun, driver-core

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v7 3/3] PCI: Add support for PCIe WAKE# interrupt
  2026-02-23 14:07   ` Manivannan Sadhasivam
@ 2026-02-25 12:32     ` Krishna Chaitanya Chundru
  0 siblings, 0 replies; 13+ messages in thread
From: Krishna Chaitanya Chundru @ 2026-02-25 12:32 UTC (permalink / raw)
  To: Manivannan Sadhasivam
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, Greg Kroah-Hartman,
	Danilo Krummrich, Bjorn Helgaas, Bartosz Golaszewski,
	Linus Walleij, Bartosz Golaszewski, linux-pm, linux-kernel,
	linux-pci, linux-gpio, quic_vbadigan, quic_mrana, sherry.sun,
	driver-core



On 2/23/2026 7:37 PM, Manivannan Sadhasivam wrote:
> On Wed, Feb 18, 2026 at 01:42:25PM +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.
>>
>> When a device asserts WAKE#, PM core will wakeup the system, resume the
>> device and its parent(s) in the hierarchy, which will cause the restoration
>> of power and refclk to the device.
>>
>> WAKE# is added in dts schema and merged based on below links.
>>
>> Link: https://lore.kernel.org/all/20250515090517.3506772-1-krishna.chundru@oss.qualcomm.com/
>> Link: https://github.com/devicetree-org/dt-schema/pull/170
>> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>> Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
>> ---
>>   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/pci.h  |  2 ++
>>   6 files changed, 77 insertions(+)
>>
>> diff --git a/drivers/pci/of.c b/drivers/pci/of.c
>> index 9bb5f258759be3f1e23496f083353600a4ef6743..23248900253faafaf9509d87c531b454fca41798 100644
>> --- a/drivers/pci/of.c
>> +++ b/drivers/pci/of.c
>> @@ -7,6 +7,7 @@
>>   #define pr_fmt(fmt)	"PCI: OF: " fmt
>>   
>>   #include <linux/cleanup.h>
>> +#include <linux/gpio/consumer.h>
>>   #include <linux/irqdomain.h>
>>   #include <linux/kernel.h>
>>   #include <linux/pci.h>
>> @@ -15,6 +16,7 @@
>>   #include <linux/of_address.h>
>>   #include <linux/of_pci.h>
>>   #include <linux/platform_device.h>
>> +#include <linux/pm_wakeirq.h>
>>   #include "pci.h"
>>   
>>   #ifdef CONFIG_PCI
>> @@ -586,6 +588,59 @@ int of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin)
>>   	return irq_create_of_mapping(&oirq);
>>   }
>>   EXPORT_SYMBOL_GPL(of_irq_parse_and_map_pci);
>> +
>> +static void pci_configure_wake_irq(struct pci_dev *pdev, struct gpio_desc *wake)
>> +{
>> +	int ret, wake_irq;
>> +
>> +	wake_irq = gpiod_to_irq(wake);
>> +	if (wake_irq < 0) {
>> +		pci_err(pdev, "Failed to get wake irq: %d\n", wake_irq);
>> +		return;
>> +	}
>> +
>> +	device_init_wakeup(&pdev->dev, true);
>> +
>> +	ret = dev_pm_set_dedicated_shared_wake_irq(&pdev->dev, wake_irq,
>> +						   IRQ_TYPE_EDGE_FALLING);
>> +	if (ret < 0) {
>> +		pci_err(pdev, "Failed to set wake IRQ: %d\n", ret);
>> +		device_init_wakeup(&pdev->dev, false);
>> +	}
>> +}
>> +
>> +void pci_configure_of_wake_gpio(struct pci_dev *dev)
>> +{
>> +	struct device_node *dn = pci_device_to_OF_node(dev);
>> +	struct pci_dev *upstream;
>> +	struct gpio_desc *gpio;
>> +
>> +	if (!dn)
>> +		return;
>> +
>> +	gpio = fwnode_gpiod_get(of_fwnode_handle(dn), "wake",
>> +				GPIOD_IN | GPIOD_FLAGS_BIT_NONEXCLUSIVE, NULL);
>> +	if (IS_ERR(gpio)) {
>> +		/*
>> +		 * In case the entire topology shares a single WAKE# signal, look for it
>> +		 * in the upstream bridge node. But if it is not Root Port, then skip it.
>> +		 */
> This comment need to be a bit more verbose. Something like,
>
> "The devices in a hierarchy expose wakeup capability through the 'wake-gpios'
> property defined either in the device node or in the Slot node. So first check
> for the property in device node and if not available, check in the Slot node."
>
> Also, move it above fwnode_gpiod_get().
ack.
>> +		upstream = pci_upstream_bridge(dev);
>> +		if (upstream && pci_is_root_bus(upstream->bus) && upstream->wake)
> Check directly in the Root Port (Slot) node.
>
>> +			pci_configure_wake_irq(dev, upstream->wake);
> I don't think we need to request an IRQ in the fallback case. Let's assume that
> there is a single device in hierarchy and the wake-gpios property is defined in
> the Slot node. So here, we should just let the PCI/PM core know that this device
> supports wakeup and PME_EN needs to be set (if the device is also capable of
> generating PME#).
>
> And then we should call pci_configure_wake_irq() from platform_pci_set_wakeup()
> to setup the IRQ handler only for the device which has the wake-gpios property.
>
> So the flow would be:
>
> pci_device_add()->platform_pci_init_wakeup()->of_pci_init_wakeup():
> Request fwnode_gpiod_get() and call device_init_wakeup()
> and set 'dev->wake' if WAKE# is available in the device node. If not, then check
> the Root Port (Slot) node and if WAKE# is available, then just call
> device_init_wakeup() to indicate the PCI and PM cores that this device *may*
> support wakeup.
>
> pci_enable_wake()->platform_pci_set_wakeup()->of_pci_set_wakeup():
> Request WAKE# IRQ only if the device has the wake-gpios property ie., dev->wake
> set. If only the Slot supports wakeup, then the IRQ should be requested for the
> Root Port device. This will allow us to keep both the ACPI and OF platform code
> in sync to some extent.
>
> Then once the WAKE# is asserted, the platform will wakeup with the help of the
> above wakeup event and the host controller driver will apply power to the
> hierarchy.
>
> But you do not seem to call pci_pme_wakeup_bus() after resume...
when we call dev_pm_set_dedicated_shared_wake_irq(), this will request 
an IRQ and by default it will be disabled. The IRQ will be enabled only 
in case of system suspend & after runtime suspend and only if wakeup is 
enabled for the device. I will add this info as a comment, so that it 
will be more clear and also in the commit text. The IRQ handler which 
will be triggered as part of WAKE# IRQ will trigger pm_runtime_resume() 
as per[1]. This will resume the devcie from D3cold to D0. once the 
device is in D0, the endpoint which requests the wake will send PME 
event and that is handled by PCI core already either through polling in 
pci core [2] or pme service in porbus driver[3] [1] wakeirq.c - 
drivers/base/power/wakeirq.c - Linux source code v6.19-rc5 - Bootlin 
Elixir Cross Referencer 
<https://elixir.bootlin.com/linux/v6.19-rc5/source/drivers/base/power/wakeirq.c#L163>
[2] pci.c - drivers/pci/pci.c - Linux source code v6.19-rc5 - Bootlin 
Elixir Cross Referencer 
<https://elixir.bootlin.com/linux/v6.19-rc5/source/drivers/pci/pci.c#L2378>
[3] pme.c - drivers/pci/pcie/pme.c - Linux source code v6.19-rc5 - 
Bootlin Elixir Cross Referencer 
<https://elixir.bootlin.com/linux/v6.19-rc5/source/drivers/pci/pcie/pme.c#L82>

- Krishna Chaitanya.
>> +	} else {
>> +		dev->wake = gpio;
>> +		pci_configure_wake_irq(dev, gpio);
>> +	}
>> +}
>> +
>> +void pci_remove_of_wake_gpio(struct pci_dev *dev)
>> +{
> Missing of_node check.
>
>> +	dev_pm_clear_wake_irq(&dev->dev);
>> +	device_init_wakeup(&dev->dev, false);
>> +	gpiod_put(dev->wake);
>> +	dev->wake = NULL;
>> +}
>>   #endif	/* CONFIG_OF_IRQ */
>>   
>>   static int pci_parse_request_of_pci_ranges(struct device *dev,
>> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
>> index f3244630bfd05b15d52f866d80a015ed21f98f49..225cb861b3425700fc0d9d4805f5d9efcaab6f56 100644
>> --- a/drivers/pci/pci.c
>> +++ b/drivers/pci/pci.c
>> @@ -1123,6 +1123,15 @@ static inline bool platform_pci_bridge_d3(struct pci_dev *dev)
>>   	return acpi_pci_bridge_d3(dev);
>>   }
>>   
>> +void platform_pci_configure_wake(struct pci_dev *dev)
>> +{
>> +	return pci_configure_of_wake_gpio(dev);
>> +}
>> +
>> +void platform_pci_remove_wake(struct pci_dev *dev)
>> +{
>> +	return pci_remove_of_wake_gpio(dev);
>> +}
> As mentioned above, these should go away and be part of
> platform_pci_set_wakeup().
>
>>   /**
>>    * pci_update_current_state - Read power state of given device and cache it
>>    * @dev: PCI device to handle.
>> diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
>> index 13d998fbacce6698514d92500dfea03cc562cdc2..22709573e41caf0ed45b20ee7ded5963f55aa9fe 100644
>> --- a/drivers/pci/pci.h
>> +++ b/drivers/pci/pci.h
>> @@ -282,6 +282,8 @@ void pci_msix_init(struct pci_dev *dev);
>>   bool pci_bridge_d3_possible(struct pci_dev *dev);
>>   void pci_bridge_d3_update(struct pci_dev *dev);
>>   int pci_bridge_wait_for_secondary_bus(struct pci_dev *dev, char *reset_type);
>> +void platform_pci_configure_wake(struct pci_dev *dev);
>> +void platform_pci_remove_wake(struct pci_dev *dev);
>>   
>>   static inline bool pci_bus_rrs_vendor_id(u32 l)
>>   {
>> @@ -1195,6 +1197,9 @@ void pci_release_of_node(struct pci_dev *dev);
>>   void pci_set_bus_of_node(struct pci_bus *bus);
>>   void pci_release_bus_of_node(struct pci_bus *bus);
>>   
>> +void pci_configure_of_wake_gpio(struct pci_dev *dev);
>> +void pci_remove_of_wake_gpio(struct pci_dev *dev);
>> +
>>   int devm_of_pci_bridge_init(struct device *dev, struct pci_host_bridge *bridge);
>>   bool of_pci_supply_present(struct device_node *np);
>>   int of_pci_get_equalization_presets(struct device *dev,
>> @@ -1240,6 +1245,9 @@ static inline int devm_of_pci_bridge_init(struct device *dev, struct pci_host_br
>>   	return 0;
>>   }
>>   
>> +static inline void pci_configure_of_wake_gpio(struct pci_dev *dev) { }
>> +static inline void pci_remove_of_wake_gpio(struct pci_dev *dev) { }
>> +
> You've added function definitions under CONFIG_OF_IRQ, but stubs under
> CONFIG_OF. This is why kernel robot also barks at you.
>
> Move the stubs to include/linux/of_pci.h under CONFIG_OF_IRQ guard.
>
> - Mani
>
>>   static inline bool of_pci_supply_present(struct device_node *np)
>>   {
>>   	return false;
>> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
>> index 2975974f35e88b5025701d2b721df8386419de8d..7f5132c0c8de36a6ec2775468a3d4e5156a046d0 100644
>> --- a/drivers/pci/probe.c
>> +++ b/drivers/pci/probe.c
>> @@ -2771,6 +2771,8 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
>>   	/* Establish pdev->tsm for newly added (e.g. new SR-IOV VFs) */
>>   	pci_tsm_init(dev);
>>   
>> +	platform_pci_configure_wake(dev);
>> +
>>   	pci_npem_create(dev);
>>   
>>   	pci_doe_sysfs_init(dev);
>> diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c
>> index e9d519993853f92f1810d3eff9f44ca7e3e1abd9..d781b41e57c4444077075690cec926a9fe15334f 100644
>> --- a/drivers/pci/remove.c
>> +++ b/drivers/pci/remove.c
>> @@ -35,6 +35,7 @@ static void pci_destroy_dev(struct pci_dev *dev)
>>   	if (pci_dev_test_and_set_removed(dev))
>>   		return;
>>   
>> +	platform_pci_remove_wake(dev);
>>   	pci_doe_sysfs_teardown(dev);
>>   	pci_npem_remove(dev);
>>   
>> diff --git a/include/linux/pci.h b/include/linux/pci.h
>> index 1c270f1d512301de4d462fe7e5097c32af5c6f8d..d1e08df8a8deaa87780589f23242767fdcdba541 100644
>> --- a/include/linux/pci.h
>> +++ b/include/linux/pci.h
>> @@ -586,6 +586,8 @@ struct pci_dev {
>>   	/* These methods index pci_reset_fn_methods[] */
>>   	u8 reset_methods[PCI_NUM_RESET_METHODS]; /* In priority order */
>>   
>> +	struct gpio_desc *wake; /* Holds WAKE# gpio */
>> +
>>   #ifdef CONFIG_PCIE_TPH
>>   	u16		tph_cap;	/* TPH capability offset */
>>   	u8		tph_mode;	/* TPH mode */
>>
>> -- 
>> 2.34.1
>>
>>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v7 0/3] PCI: Add support for PCIe WAKE# interrupt
  2026-02-18 10:01 ` [PATCH v7 0/3] " Bartosz Golaszewski
  2026-02-24  8:13   ` Chen-Yu Tsai
@ 2026-03-13  7:03   ` Krishna Chaitanya Chundru
  1 sibling, 0 replies; 13+ messages in thread
From: Krishna Chaitanya Chundru @ 2026-03-13  7:03 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, Greg Kroah-Hartman,
	Danilo Krummrich, Bjorn Helgaas, Linus Walleij, linux-pm,
	linux-kernel, linux-pci, linux-gpio, quic_vbadigan, quic_mrana,
	sherry.sun, driver-core



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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-03-13  7:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-18  8:12 [PATCH v7 0/3] PCI: Add support for PCIe WAKE# interrupt Krishna Chaitanya Chundru
2026-02-18  8:12 ` [PATCH v7 1/3] PM: sleep: wakeirq: Add support for dedicated shared wake IRQ setup Krishna Chaitanya Chundru
2026-02-18  8:12 ` [PATCH v7 2/3] gpio: Add fwnode_gpiod_get() helper Krishna Chaitanya Chundru
2026-02-19 17:45   ` Linus Walleij
2026-02-23 12:53   ` Manivannan Sadhasivam
2026-02-18  8:12 ` [PATCH v7 3/3] PCI: Add support for PCIe WAKE# interrupt Krishna Chaitanya Chundru
2026-02-18 13:49   ` kernel test robot
2026-02-18 16:58   ` kernel test robot
2026-02-23 14:07   ` Manivannan Sadhasivam
2026-02-25 12:32     ` Krishna Chaitanya Chundru
2026-02-18 10:01 ` [PATCH v7 0/3] " Bartosz Golaszewski
2026-02-24  8:13   ` Chen-Yu Tsai
2026-03-13  7:03   ` Krishna Chaitanya Chundru

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox