Skip to contentSkip to conversation

irqchip: vic: Support cascaded VIC in device tree

PATCH Superseded Linus Walleij 2 participants 2 messages Feb 13, 2020 – Feb 19, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irqchip: vic: Support cascaded VIC in device tree

When transitioning some elder platforms to device tree it becomes necessary to cascade VIC IRQ chips off another interrupt controller.

Tested with the cascaded VIC on the Integrator/AP attached logic module IM-PD1.

---
 drivers/irqchip/irq-vic.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/irqchip/irq-vic.c +5 -4
index f3f20a3cff50..caff21b4bac6 100644
@@ -509,9 +509,7 @@ static int __init vic_of_init(struct device_node *node,
 	void __iomem *regs;
 	u32 interrupt_mask = ~0;
 	u32 wakeup_mask = ~0;
-
-	if (WARN(parent, "non-root VICs are not supported"))
-		return -EINVAL;
+	int parent_irq = 0;
 
 	regs = of_iomap(node, 0);
 	if (WARN_ON(!regs))
@@ -519,11 +517,14 @@ static int __init vic_of_init(struct device_node *node,
 
 	of_property_read_u32(node, "valid-mask", &interrupt_mask);
 	of_property_read_u32(node, "valid-wakeup-mask", &wakeup_mask);
+	parent_irq = of_irq_get(node, 0);
+	if (parent_irq < 0)
+		parent_irq = 0;
 
 	/*
 	 * Passing 0 as first IRQ makes the simple domain allocate descriptors
 	 */
-	__vic_init(regs, 0, 0, interrupt_mask, wakeup_mask, node);
+	__vic_init(regs, parent_irq, 0, interrupt_mask, wakeup_mask, node);
 
 	return 0;
 }
Signature · 1 line
2.23.0
#1 lore raw

Hi Linus,

Please use my kernel.org email address, I just rescued this email from the ML...

Quoted 17 lines · Linus Walleij

When transitioning some elder platforms to device tree it becomes necessary to cascade VIC IRQ chips off another interrupt controller.

Tested with the cascaded VIC on the Integrator/AP attached logic module IM-PD1.

---
 drivers/irqchip/irq-vic.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/irqchip/irq-vic.c +0 -0
index f3f20a3cff50..caff21b4bac6 100644

drivers/irqchip/irq-vic.c static int __init vic_of_init(struct device_node · line 513

Quoted 8 lines
drivers/irqchip/irq-vic.c +1 -3
@@ -509,9 +509,7 @@ static int __init vic_of_init(struct device_node 
 *node,
 	void __iomem *regs;
 	u32 interrupt_mask = ~0;
 	u32 wakeup_mask = ~0;
-
-	if (WARN(parent, "non-root VICs are not supported"))
-		return -EINVAL;
+	int parent_irq = 0;

nit: Do you need this to be initialized to zero?

Quoted 15 lines
drivers/irqchip/irq-vic.c +3 -0
 	regs = of_iomap(node, 0);
 	if (WARN_ON(!regs))
@@ -519,11 +517,14 @@ static int __init vic_of_init(struct device_node 
 *node,
 
 	of_property_read_u32(node, "valid-mask", &interrupt_mask);
 	of_property_read_u32(node, "valid-wakeup-mask", &wakeup_mask);
+	parent_irq = of_irq_get(node, 0);
+	if (parent_irq < 0)
+		parent_irq = 0;
 
 	/*
 	 * Passing 0 as first IRQ makes the simple domain allocate 

descriptors

drivers/irqchip/irq-vic.c static int __init vic_of_init(struct device_node *node, · line 530

Quoted 6 lines
drivers/irqchip/irq-vic.c +1 -1
 	 */
-	__vic_init(regs, 0, 0, interrupt_mask, wakeup_mask, node);
+	__vic_init(regs, parent_irq, 0, interrupt_mask, wakeup_mask, node);
 
 	return 0;
 }

Do you want this as a fix?

Thanks,

        M.
Signature · 1 line
Jazz is not dead. It just smells funny...