]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
powerpc/pci: Remove pcibios_setup_bus_devices()
authorOliver O'Halloran <oohall@gmail.com>
Mon, 28 Oct 2019 08:54:24 +0000 (19:54 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 6 Jan 2020 05:25:29 +0000 (16:25 +1100)
With the previous patch applied pcibios_setup_device() will always be run
when pcibios_bus_add_device() is called. There are several code paths where
pcibios_setup_bus_device() is still called (the PowerPC specific PCI
hotplug support is one) so with just the previous patch applied the setup
can be run multiple times on a device, once before the device is added
to the bus and once after.

There's no need to run the setup in the early case any more so just
remove it entirely.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191028085424.12006-3-oohall@gmail.com
arch/powerpc/include/asm/pci.h
arch/powerpc/kernel/pci-common.c
arch/powerpc/kernel/pci-hotplug.c
arch/powerpc/kernel/pci_of_scan.c

index 327567b8f7d6faa9a2ef60cf7b108358768872f7..63ed7e3b0ba3e41c428d1607683273b9f58d39e3 100644 (file)
@@ -113,7 +113,6 @@ extern pgprot_t     pci_phys_mem_access_prot(struct file *file,
                                         pgprot_t prot);
 
 extern resource_size_t pcibios_io_space_offset(struct pci_controller *hose);
-extern void pcibios_setup_bus_devices(struct pci_bus *bus);
 extern void pcibios_setup_bus_self(struct pci_bus *bus);
 extern void pcibios_setup_phb_io_space(struct pci_controller *hose);
 extern void pcibios_scan_phb(struct pci_controller *hose);
index b89925ede9351f192639f96f70d16c32e501c515..f8a59d7b724cdb9cff3418e78438c7b49e292fc7 100644 (file)
@@ -1000,24 +1000,6 @@ int pcibios_add_device(struct pci_dev *dev)
        return 0;
 }
 
-void pcibios_setup_bus_devices(struct pci_bus *bus)
-{
-       struct pci_dev *dev;
-
-       pr_debug("PCI: Fixup bus devices %d (%s)\n",
-                bus->number, bus->self ? pci_name(bus->self) : "PHB");
-
-       list_for_each_entry(dev, &bus->devices, bus_list) {
-               /* Cardbus can call us to add new devices to a bus, so ignore
-                * those who are already fully discovered
-                */
-               if (pci_dev_is_added(dev))
-                       continue;
-
-               pcibios_setup_device(dev);
-       }
-}
-
 void pcibios_set_master(struct pci_dev *dev)
 {
        /* No special bus mastering setup handling */
@@ -1036,13 +1018,6 @@ void pcibios_fixup_bus(struct pci_bus *bus)
 }
 EXPORT_SYMBOL(pcibios_fixup_bus);
 
-void pci_fixup_cardbus(struct pci_bus *bus)
-{
-       /* Now fixup devices on that bus */
-       pcibios_setup_bus_devices(bus);
-}
-
-
 static int skip_isa_ioresource_align(struct pci_dev *dev)
 {
        if (pci_has_flag(PCI_CAN_SKIP_ISA_ALIGN) &&
index fc62c4bc47b14e61e45b150999a7f61ad457e340..d6a67f814983d05c1b6fa299f3db638c1b216df3 100644 (file)
@@ -134,7 +134,6 @@ void pci_hp_add_devices(struct pci_bus *bus)
                 */
                slotno = PCI_SLOT(PCI_DN(dn->child)->devfn);
                pci_scan_slot(bus, PCI_DEVFN(slotno, 0));
-               pcibios_setup_bus_devices(bus);
                max = bus->busn_res.start;
                /*
                 * Scan bridges that are already configured. We don't touch
index f91d7e94872ebdd00a8759aafa01ce1d8a14e439..c3024f1047654c3a9ef774a2ab1395407032cf15 100644 (file)
@@ -414,7 +414,6 @@ static void __of_scan_bus(struct device_node *node, struct pci_bus *bus,
         */
        if (!rescan_existing)
                pcibios_setup_bus_self(bus);
-       pcibios_setup_bus_devices(bus);
 
        /* Now scan child busses */
        for_each_pci_bridge(dev, bus)