]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
powerpc/eeh: Create PHB PEs after EEH is initialized
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 7 Sep 2017 06:35:40 +0000 (16:35 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Oct 2017 07:47:29 +0000 (09:47 +0200)
commit 3e77adeea3c5393c9b624832f65441e92867f618 upstream.

Otherwise we end up not yet having computed the right diag data size
on powernv where EEH initialization is delayed, thus causing memory
corruption later on when calling OPAL.

Fixes: 5cb1f8fdddb7 ("powerpc/powernv/pci: Dynamically allocate PHB diag data")
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/kernel/eeh.c
arch/powerpc/kernel/eeh_dev.c

index 63992b2d8e15684a17e05981fbfd8260ee45af50..f27eecd5ec7fe87954555687c1b0cb5bdc634466 100644 (file)
@@ -1018,6 +1018,10 @@ int eeh_init(void)
        } else if ((ret = eeh_ops->init()))
                return ret;
 
+       /* Initialize PHB PEs */
+       list_for_each_entry_safe(hose, tmp, &hose_list, list_node)
+               eeh_dev_phb_init_dynamic(hose);
+
        /* Initialize EEH event */
        ret = eeh_event_init();
        if (ret)
index d6b2ca70d14d7046637967646f9210ca52c2e2d3..0820b73288c0d5288e8fe87116b12ce3e2fac672 100644 (file)
@@ -83,21 +83,3 @@ void eeh_dev_phb_init_dynamic(struct pci_controller *phb)
        /* EEH PE for PHB */
        eeh_phb_pe_create(phb);
 }
-
-/**
- * eeh_dev_phb_init - Create EEH devices for devices included in existing PHBs
- *
- * Scan all the existing PHBs and create EEH devices for their OF
- * nodes and their children OF nodes
- */
-static int __init eeh_dev_phb_init(void)
-{
-       struct pci_controller *phb, *tmp;
-
-       list_for_each_entry_safe(phb, tmp, &hose_list, list_node)
-               eeh_dev_phb_init_dynamic(phb);
-
-       return 0;
-}
-
-core_initcall(eeh_dev_phb_init);