]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
irqchip/gic-v3: Report failures in gic_irq_domain_alloc
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Tue, 4 Jul 2017 09:56:33 +0000 (10:56 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Tue, 4 Jul 2017 10:11:25 +0000 (11:11 +0100)
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 443acc4f37f6 ("irqchip: GICv3: Convert to domain hierarchy")
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>
drivers/irqchip/irq-gic-v3.c

index dbffb7ab62033b346ca7fc3b3468d6bcb3a19a63..47630e9998b3df928f37abe0d19586052585308f 100644 (file)
@@ -831,8 +831,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;
 }