]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/irqchip/irq-gic.c
irqchip/gic: Don't initialise chip if mapping IO space fails
[karo-tx-linux.git] / drivers / irqchip / irq-gic.c
index 282344b95ec2b41c5e081c9d73199bb0a66b21d9..612a3584a282d10aa0f24574c7f1fdcdf1ac9e37 100644 (file)
@@ -344,6 +344,14 @@ static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
                        if (static_key_true(&supports_deactivate))
                                writel_relaxed(irqstat, cpu_base + GIC_CPU_DEACTIVATE);
 #ifdef CONFIG_SMP
+                       /*
+                        * Ensure any shared data written by the CPU sending
+                        * the IPI is read after we've read the ACK register
+                        * on the GIC.
+                        *
+                        * Pairs with the write barrier in gic_raise_softirq
+                        */
+                       smp_rmb();
                        handle_IPI(irqnr, regs);
 #endif
                        continue;
@@ -1201,10 +1209,14 @@ gic_of_init(struct device_node *node, struct device_node *parent)
                return -ENODEV;
 
        dist_base = of_iomap(node, 0);
-       WARN(!dist_base, "unable to map gic dist registers\n");
+       if (WARN(!dist_base, "unable to map gic dist registers\n"))
+               return -ENOMEM;
 
        cpu_base = of_iomap(node, 1);
-       WARN(!cpu_base, "unable to map gic cpu registers\n");
+       if (WARN(!cpu_base, "unable to map gic cpu registers\n")) {
+               iounmap(dist_base);
+               return -ENOMEM;
+       }
 
        /*
         * Disable split EOI/Deactivate if either HYP is not available