public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] irqchip/jcore-aic: Fix missing allocation of IRQ descriptors
@ 2023-05-10 16:33 John Paul Adrian Glaubitz
  2023-05-11  6:56 ` Marc Zyngier
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: John Paul Adrian Glaubitz @ 2023-05-10 16:33 UTC (permalink / raw)
  Cc: John Paul Adrian Glaubitz, Thomas Gleixner, Marc Zyngier,
	Rich Felker, Jason Cooper, linux-kernel

The initialization function for the J-Core AIC aic_irq_of_init() is
currently missing the call to irq_alloc_descs() which allocates and
initializes all the IRQ descriptors. Add missing function call and
return the error code from irq_alloc_descs() in case the allocation
fails.

Fixes: 981b58f66cfc ("irqchip/jcore-aic: Add J-Core AIC driver")
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
---
 drivers/irqchip/irq-jcore-aic.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/irqchip/irq-jcore-aic.c b/drivers/irqchip/irq-jcore-aic.c
index 5f47d8ee4ae3..b9dcc8e78c75 100644
--- a/drivers/irqchip/irq-jcore-aic.c
+++ b/drivers/irqchip/irq-jcore-aic.c
@@ -68,6 +68,7 @@ static int __init aic_irq_of_init(struct device_node *node,
 	unsigned min_irq = JCORE_AIC2_MIN_HWIRQ;
 	unsigned dom_sz = JCORE_AIC_MAX_HWIRQ+1;
 	struct irq_domain *domain;
+	int ret;
 
 	pr_info("Initializing J-Core AIC\n");
 
@@ -100,6 +101,12 @@ static int __init aic_irq_of_init(struct device_node *node,
 	jcore_aic.irq_unmask = noop;
 	jcore_aic.name = "AIC";
 
+	ret = irq_alloc_descs(-1, min_irq, dom_sz - min_irq,
+			      of_node_to_nid(node));
+
+	if (ret < 0)
+		return ret;
+
 	domain = irq_domain_add_legacy(node, dom_sz - min_irq, min_irq, min_irq,
 				       &jcore_aic_irqdomain_ops,
 				       &jcore_aic);
-- 
2.39.2


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

end of thread, other threads:[~2023-06-17  7:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-10 16:33 [PATCH] irqchip/jcore-aic: Fix missing allocation of IRQ descriptors John Paul Adrian Glaubitz
2023-05-11  6:56 ` Marc Zyngier
2023-05-11  7:22   ` John Paul Adrian Glaubitz
2023-05-11  8:47     ` Marc Zyngier
2023-05-11  9:03       ` John Paul Adrian Glaubitz
2023-05-16 10:06         ` Marc Zyngier
2023-05-16 10:15           ` John Paul Adrian Glaubitz
2023-05-11 14:35 ` Geert Uytterhoeven
2023-05-11 14:47   ` John Paul Adrian Glaubitz
2023-05-12  3:21 ` Rob Landley
2023-06-17  7:02 ` [irqchip: irq/irqchip-next] " irqchip-bot for John Paul Adrian Glaubitz

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