Skip to contentSkip to conversation

irqchip/qcom-pdc: Handle ESPIs in qcom,pdc-ranges

PATCH Applied Konrad Dybcio 2 participants 2 messages Nov 2 – Nov 11

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 irqchip/qcom-pdc: Handle ESPIs in qcom,pdc-ranges

From: Konrad Dybcio <[email protected]>

The qcom,pdc-ranges property maps GIC interrupts to PDC output pins. That data is then subsequently used by irq_domain to resolve into the interrupt parent (which again, is always GIC).

The code that handles this hardcodes parent_fwspec.param[0] = 0 (GIC_SPI). Make that conditional to prevent this warning at boot:

GICv3: SPI 4115 out of range (use ESPI?)

Fixes 81ef8bf88065 ("irqchip/qcom-pdc: Add irqdomain for wakeup capable GPIOs")

---
Changes in v2:
- Drop the arm-specific header, replace with an 4096 literal
- Link to v1: https://patch.msgid.link/[email protected]

To: Thomas Gleixner <[email protected]>
To: Radu Rendec <[email protected]>
To: Stephen Boyd <[email protected]>
To: Lina Iyer <[email protected]>
To: Marc Zyngier <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 drivers/irqchip/qcom-pdc.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/irqchip/qcom-pdc.c +9 -2
index 29025a212ece..6c2a2d13629c 100644
@@ -21,6 +21,7 @@
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/firmware/qcom/qcom_scm.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
 
 #define PDC_MAX_IRQS			256
 #define IRQ_ENABLE_BANK_MAX		BITS_TO_BYTES(PDC_MAX_IRQS)
@@ -597,8 +598,14 @@ static int qcom_pdc_alloc(struct irq_domain *domain, unsigned int virq,
 
 	parent_fwspec.fwnode      = domain->parent->fwnode;
 	parent_fwspec.param_count = 3;
-	parent_fwspec.param[0]    = 0;
-	parent_fwspec.param[1]    = pin_to_hwirq(region, hwirq);
+	/* GIC ESPIs start at 4096 */
+	if (pin_to_hwirq(region, hwirq) >= 4096) {
+		parent_fwspec.param[0] = GIC_ESPI;
+		parent_fwspec.param[1] = pin_to_hwirq(region, hwirq) - 4096;
+	} else {
+		parent_fwspec.param[0] = GIC_SPI;
+		parent_fwspec.param[1] = pin_to_hwirq(region, hwirq);
+	}
 	parent_fwspec.param[2]    = type;
 
 	return irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, &parent_fwspec);

---
base-commit: 2efb7a11f1aa4d2dc285fe2680cca22cb9f72f64
change-id: 20261022-topic-pdc_map_espi-43d4300dd856

Best regards,

Signature · 1 line
Konrad Dybcio <[email protected]>
merge bot Applied
#1 lore raw
The following commit has been merged into the irq/drivers branch of tip:

The following commit has been merged into the irq/drivers branch of tip:

Commit-ID:     d793f5346645adbafa2385dee4c16bd6b5d384a5
Gitweb:        https://git.kernel.org/tip/d793f5346645adbafa2385dee4c16bd6b5d384a5
Author:        Konrad Dybcio <[email protected]>
AuthorDate:    Mon, 02 Nov 2026 16:45:48 +01:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Mon, 09 Nov 2026 11:16:44 +01:00

irqchip/qcom-pdc: Handle ESPIs in qcom,pdc-ranges

The qcom,pdc-ranges property maps GIC interrupts to PDC output pins. That data is then subsequently used by irq_domain to resolve into the interrupt parent (which again, is always GIC).

The code that handles this hardcodes parent_fwspec.param[0] = 0 (GIC_SPI). Make that conditional to prevent this warning at boot:

GICv3: SPI 4115 out of range (use ESPI?)

Fixes 81ef8bf88065 ("irqchip/qcom-pdc: Add irqdomain for wakeup capable GPIOs")
---
 drivers/irqchip/qcom-pdc.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/irqchip/qcom-pdc.c +9 -2
index 29025a2..6c2a2d1 100644
@@ -21,6 +21,7 @@
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/firmware/qcom/qcom_scm.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
 
 #define PDC_MAX_IRQS			256
 #define IRQ_ENABLE_BANK_MAX		BITS_TO_BYTES(PDC_MAX_IRQS)
@@ -597,8 +598,14 @@ static int qcom_pdc_alloc(struct irq_domain *domain, unsigned int virq,
 
 	parent_fwspec.fwnode      = domain->parent->fwnode;
 	parent_fwspec.param_count = 3;
-	parent_fwspec.param[0]    = 0;
-	parent_fwspec.param[1]    = pin_to_hwirq(region, hwirq);
+	/* GIC ESPIs start at 4096 */
+	if (pin_to_hwirq(region, hwirq) >= 4096) {
+		parent_fwspec.param[0] = GIC_ESPI;
+		parent_fwspec.param[1] = pin_to_hwirq(region, hwirq) - 4096;
+	} else {
+		parent_fwspec.param[0] = GIC_SPI;
+		parent_fwspec.param[1] = pin_to_hwirq(region, hwirq);
+	}
 	parent_fwspec.param[2]    = type;
 
 	return irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, &parent_fwspec);