summaryrefslogtreecommitdiffstats
path: root/drivers/irqchip/irq-gic.c
diff options
context:
space:
mode:
authorSuzuki K Poulose2017-07-04 11:56:34 +0200
committerMarc Zyngier2017-07-04 12:11:25 +0200
commit456c59c31c5126fe31c64956c43670060ea9debd (patch)
tree84210caf9ef36002a361f93a720073789e8be035 /drivers/irqchip/irq-gic.c
parentirqchip/atmel-aic: Remove root argument from ->fixup() prototype (diff)
downloadkernel-qcow2-linux-456c59c31c5126fe31c64956c43670060ea9debd.tar.gz
kernel-qcow2-linux-456c59c31c5126fe31c64956c43670060ea9debd.tar.xz
kernel-qcow2-linux-456c59c31c5126fe31c64956c43670060ea9debd.zip
irqchip/gic-v2: Report failures in gic_irq_domain_alloc
If the GIC cannot map an IRQ via irq_domain_ops->alloc(), it doesn't return an error code. This can cause a problem with drivers, where it thinks it has successfully got an IRQ for the device, but requesting the same ends up failure with -ENOSYS (as the IRQ's chip is not set). Fixes: commit 9a1091ef0017c ("irqchip: gic: Support hierarchy irq domain.") Cc: Yingjoe Chen <yingjoe.chen@mediatek.com> Cc: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'drivers/irqchip/irq-gic.c')
-rw-r--r--drivers/irqchip/irq-gic.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 1b1df4f770bd..940c16278758 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -1027,8 +1027,11 @@ static int gic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
if (ret)
return ret;
- for (i = 0; i < nr_irqs; i++)
- gic_irq_domain_map(domain, virq + i, hwirq + i);
+ for (i = 0; i < nr_irqs; i++) {
+ ret = gic_irq_domain_map(domain, virq + i, hwirq + i);
+ if (ret)
+ return ret;
+ }
return 0;
}