powerpc/eeh: Remove eeh_add_device_tree_late()
authorOliver O'Halloran <oohall@gmail.com>
Fri, 6 Mar 2020 07:39:00 +0000 (18:39 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 25 Mar 2020 01:09:38 +0000 (12:09 +1100)
On pseries and PowerNV pcibios_bus_add_device() calls eeh_add_device_late()
so there's no need to do a separate tree traversal to bind the eeh_dev and
pci_dev together setting up the PHB at boot. As a result we can remove
eeh_add_device_tree_late().

Reviewed-by: Sam Bobroff <sbobroff@linux.ibm.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200306073904.4737-2-oohall@gmail.com
arch/powerpc/include/asm/eeh.h
arch/powerpc/kernel/eeh.c
arch/powerpc/kernel/of_platform.c
arch/powerpc/kernel/pci-common.c

index 5a349079057ddcd872f5cf9ddce3edc7e34df828..5d10781664174e124ed656ebb756c0547464dcd5 100644 (file)
@@ -304,7 +304,6 @@ void eeh_addr_cache_init(void);
 void eeh_add_device_early(struct pci_dn *);
 void eeh_add_device_tree_early(struct pci_dn *);
 void eeh_add_device_late(struct pci_dev *);
-void eeh_add_device_tree_late(struct pci_bus *);
 void eeh_remove_device(struct pci_dev *);
 int eeh_unfreeze_pe(struct eeh_pe *pe);
 int eeh_pe_reset_and_recover(struct eeh_pe *pe);
@@ -365,8 +364,6 @@ static inline void eeh_add_device_tree_early(struct pci_dn *pdn) { }
 
 static inline void eeh_add_device_late(struct pci_dev *dev) { }
 
-static inline void eeh_add_device_tree_late(struct pci_bus *bus) { }
-
 static inline void eeh_remove_device(struct pci_dev *dev) { }
 
 #define EEH_POSSIBLE_ERROR(val, type) (0)
index 08789121473902043dfe46df4ca6746bd24effaa..9cb33706ef8073b08a5dde575ab19ace7f003c5b 100644 (file)
@@ -1213,31 +1213,6 @@ void eeh_add_device_late(struct pci_dev *dev)
        eeh_sysfs_add_device(dev);
 }
 
-/**
- * eeh_add_device_tree_late - Perform EEH initialization for the indicated PCI bus
- * @bus: PCI bus
- *
- * This routine must be used to perform EEH initialization for PCI
- * devices which are attached to the indicated PCI bus. The PCI bus
- * is added after system boot through hotplug or dlpar.
- */
-void eeh_add_device_tree_late(struct pci_bus *bus)
-{
-       struct pci_dev *dev;
-
-       if (eeh_has_flag(EEH_FORCE_DISABLED))
-               return;
-       list_for_each_entry(dev, &bus->devices, bus_list) {
-               eeh_add_device_late(dev);
-               if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
-                       struct pci_bus *subbus = dev->subordinate;
-                       if (subbus)
-                               eeh_add_device_tree_late(subbus);
-               }
-       }
-}
-EXPORT_SYMBOL_GPL(eeh_add_device_tree_late);
-
 /**
  * eeh_remove_device - Undo EEH setup for the indicated pci device
  * @dev: pci device to be removed
index cb6880092dd7e53f7b5423304a52914e2af6cbd4..64edac81c633271c9af133a84c264edab31fb3af 100644 (file)
@@ -80,9 +80,6 @@ static int of_pci_phb_probe(struct platform_device *dev)
         */
        pcibios_claim_one_bus(phb->bus);
 
-       /* Finish EEH setup */
-       eeh_add_device_tree_late(phb->bus);
-
        /* Add probed PCI devices to the device model */
        pci_bus_add_devices(phb->bus);
 
index 3d2b1cf30b800987b8991884e84583581bded510..8983afa6d62af7580ed925e9fbfecd5c6c9ab5ff 100644 (file)
@@ -1399,9 +1399,6 @@ void pcibios_finish_adding_to_bus(struct pci_bus *bus)
                        pci_assign_unassigned_bus_resources(bus);
        }
 
-       /* Fixup EEH */
-       eeh_add_device_tree_late(bus);
-
        /* Add new devices to global lists.  Register in proc, sysfs. */
        pci_bus_add_devices(bus);
 }