Message ID | 4e734c3aab8802b340e06b56803954b3e550157d.camel@kernel.crashing.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Why check for PCI_PROBE_ONLY in pci_common_init_dev() | expand |
On Thu, Jun 13, 2019 at 01:52:34PM +1000, Benjamin Herrenschmidt wrote: > Hi ! > > So while trying to sort out & cleanup the business with PCI resource > allocation (and do the ground work to be able to revive > https://lore.kernel.org/linux-pci/20150916085850.GA17510@red-moon/) I > stumbled upon this one: > > arch/arm/kernel/bios32.c:pci_common_init_dev() checks for > PCI_PROBE_ONLY to decide whether to claim existing resources or > reallocate. > > However, I can't see any code path leading to that function that would > have set that flag. Someone probably wanted it at some point but either that's been removed or the code was never merged. Either way, if no one is using it on 32-bit ARM, it can be killed.
On Thu, 2019-06-13 at 23:06 +0100, Russell King - ARM Linux admin wrote: > On Thu, Jun 13, 2019 at 01:52:34PM +1000, Benjamin Herrenschmidt wrote: > > Hi ! > > > > So while trying to sort out & cleanup the business with PCI resource > > allocation (and do the ground work to be able to revive > > https://lore.kernel.org/linux-pci/20150916085850.GA17510@red-moon/) I > > stumbled upon this one: > > > > arch/arm/kernel/bios32.c:pci_common_init_dev() checks for > > PCI_PROBE_ONLY to decide whether to claim existing resources or > > reallocate. > > > > However, I can't see any code path leading to that function that would > > have set that flag. > > Someone probably wanted it at some point but either that's been removed > or the code was never merged. Either way, if no one is using it on > 32-bit ARM, it can be killed. It's not used by code path using that function. "New style" stuff using drivers/pci/controller/* can still use the flag, but at least I can simplify that code. Thanks ! Cheers, Ben.
--- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c @@ -536,23 +536,13 @@ void pci_common_init_dev(struct device *parent, struct hw_pci *hw) list_for_each_entry(sys, &head, node) { struct pci_bus *bus = sys->bus; + struct pci_bus *child; - /* - * We insert PCI resources into the iomem_resource and - * ioport_resource trees in either pci_bus_claim_resources() - * or pci_bus_assign_resources(). - */ - if (pci_has_flag(PCI_PROBE_ONLY)) { - pci_bus_claim_resources(bus); - } else { - struct pci_bus *child; + pci_bus_size_bridges(bus); + pci_bus_assign_resources(bus); - pci_bus_size_bridges(bus); - pci_bus_assign_resources(bus); - - list_for_each_entry(child, &bus->children, node) - pcie_bus_configure_settings(child); - } + list_for_each_entry(child, &bus->children, node) + pcie_bus_configure_settings(child); pci_bus_add_devices(bus); }