Skip to contentSkip to conversation

irqchip/apple-aic: Correctly map the vgic maintenance interrupt

PATCH Applied Marc Zyngier 3 participants 3 messages Feb 1, 2023 – Feb 6, 2023

Subsystems (3)
lore
Share & tools
lore

Marc Zyngier

author maintainer
#0 lore raw

PATCH 1/1 irqchip/apple-aic: Correctly map the vgic maintenance interrupt

We currently allocate the vgic maintenance interrupt by calling into the low-level irqdomain code. Not only this is unnecessary, but this is also pretty wrong: we end-up skipping a bunch of irqdesc state setup

A simple "cat /proc/interrupt" shows how wrong we are, as the interrupt appears as "Edge" instead of "Level".

Instead, just call the standard irq_create_fwspec_mapping(), which is the right tool for the job. Duh.

---

Notes:
This applies to Oliver's kvm-arm64/apple-vgic-mi branch.

 drivers/irqchip/irq-apple-aic.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/irqchip/irq-apple-aic.c +1 -3
index 09fd52d91e45..76ee7c5e7b7e 100644
@@ -1201,9 +1201,7 @@ static int __init aic_of_ic_init(struct device_node *node, struct device_node *p
 			},
 		};
 
-		vgic_info.maint_irq = irq_domain_alloc_irqs(irqc->hw_domain,
-							    1, NUMA_NO_NODE,
-							    &mi);
+		vgic_info.maint_irq = irq_create_fwspec_mapping(&mi);
 		WARN_ON(!vgic_info.maint_irq);
 	}
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 25 lines · Marc Zyngier

We currently allocate the vgic maintenance interrupt by calling into the low-level irqdomain code. Not only this is unnecessary, but this is also pretty wrong: we end-up skipping a bunch of irqdesc state setup

A simple "cat /proc/interrupt" shows how wrong we are, as the interrupt appears as "Edge" instead of "Level".

Instead, just call the standard irq_create_fwspec_mapping(), which is the right tool for the job. Duh.

---

Notes:
This applies to Oliver's kvm-arm64/apple-vgic-mi branch.

 drivers/irqchip/irq-apple-aic.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/irqchip/irq-apple-aic.c +0 -0
index 09fd52d91e45..76ee7c5e7b7e 100644

drivers/irqchip/irq-apple-aic.c static int __init aic_of_ic_init(struct device_node *node, struct device_node *p · line 1207

Quoted 10 lines
drivers/irqchip/irq-apple-aic.c +1 -3
@@ -1201,9 +1201,7 @@ static int __init aic_of_ic_init(struct device_node *node, struct device_node *p
 			},
 		};
 
-		vgic_info.maint_irq = irq_domain_alloc_irqs(irqc->hw_domain,
-							    1, NUMA_NO_NODE,
-							    &mi);
+		vgic_info.maint_irq = irq_create_fwspec_mapping(&mi);
 		WARN_ON(!vgic_info.maint_irq);
 	}
 

- Hector

Applied
#2 lore raw
In reply to Marc Zyngier
Quoted 9 lines · Marc Zyngier

We currently allocate the vgic maintenance interrupt by calling into the low-level irqdomain code. Not only this is unnecessary, but this is also pretty wrong: we end-up skipping a bunch of irqdesc state setup

A simple "cat /proc/interrupt" shows how wrong we are, as the interrupt appears as "Edge" instead of "Level".

[...]

Applied to kvmarm/next, thanks!

[1/1] irqchip/apple-aic: Correctly map the vgic maintenance interrupt

      https://git.kernel.org/kvmarm/kvmarm/c/ad818e6010ef

--
Best,
Oliver