powerpc/powernv/pci: Check status of a PHB before using it
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 8 Jul 2016 06:37:17 +0000 (16:37 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 17 Jul 2016 06:42:49 +0000 (16:42 +1000)
If the firmware encounters an error (internal or HW) during initialization
of a PHB, it might leave the device-node in the tree but mark it disabled
using the "status" property. We should check it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/powernv/pci-ioda.c

index ed27f4c..891fc4a 100644 (file)
@@ -3516,6 +3516,9 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
        void *aux;
        long rc;
 
+       if (!of_device_is_available(np))
+               return;
+
        pr_info("Initializing %s PHB (%s)\n",
                pnv_phb_names[ioda_type], of_node_full_name(np));