WSL2-Linux-Kernel/arch/ia64
Yijing Wang b97ea289cf PCI: Assign resources before drivers claim devices (pci_scan_root_bus())
Previously, pci_scan_root_bus() created a root PCI bus, enumerated the
devices on it, and called pci_bus_add_devices(), which made the devices
available for drivers to claim them.

Most callers assigned resources to devices after pci_scan_root_bus()
returns, which may be after drivers have claimed the devices.  This is
incorrect; the PCI core should not change device resources while a driver
is managing the device.

Remove pci_bus_add_devices() from pci_scan_root_bus() and do it after any
resource assignment in the callers.

Note that ARM's pci_common_init_dev() already called pci_bus_add_devices()
after pci_scan_root_bus(), so we only need to remove the first call:

  pci_common_init_dev
    pcibios_init_hw
      pci_scan_root_bus
        pci_bus_add_devices        # first call
    pci_bus_assign_resources
    pci_bus_add_devices            # second call

[bhelgaas: changelog, drop "root_bus" var in alpha common_init_pci(),
return failure earlier in mn10300, add "return" in x86 pcibios_scan_root(),
return early if xtensa platform_pcibios_fixup() fails]
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Richard Henderson <rth@twiddle.net>
CC: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
CC: Matt Turner <mattst88@gmail.com>
CC: David Howells <dhowells@redhat.com>
CC: Tony Luck <tony.luck@intel.com>
CC: Michal Simek <monstr@monstr.eu>
CC: Ralf Baechle <ralf@linux-mips.org>
CC: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
CC: Sebastian Ott <sebott@linux.vnet.ibm.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: Chris Metcalf <cmetcalf@ezchip.com>
CC: Chris Zankel <chris@zankel.net>
CC: Max Filippov <jcmvbkbc@gmail.com>
CC: Thomas Gleixner <tglx@linutronix.de>
2015-03-19 10:17:13 -05:00
..
configs [IA64] refresh arch/ia64/configs/* using "make savedefconfig" 2014-09-23 11:09:29 -07:00
dig Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
hp ACPI / ia64 / sba_iommu: Restore the working initialization ordering 2014-06-16 22:33:20 +02:00
include asm-generic: uaccess.h cleanup 2015-02-18 10:02:24 -08:00
kernel ia64: use %*pb[l] to print bitmaps including cpumasks and nodemasks 2015-02-13 21:21:37 -08:00
lib Fix common misspellings 2011-03-31 11:26:23 -03:00
mm mm/hugetlb: reduce arch dependent code around follow_huge_* 2015-02-11 17:06:01 -08:00
oprofile Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
pci Merge branch 'acpica' 2015-02-10 15:58:57 +01:00
scripts scripts: change scripts to use system python instead of env 2010-02-02 14:33:56 +01:00
sn PCI: Assign resources before drivers claim devices (pci_scan_root_bus()) 2015-03-19 10:17:13 -05:00
uv ia64: change to new flag variables 2011-03-17 14:02:56 +01:00
Kconfig More ACPI and power management updates for 3.19-rc1 2014-12-18 20:28:33 -08:00
Kconfig.debug
Makefile KVM: ia64: remove 2014-11-20 11:08:33 +01:00
install.sh kbuild: use INSTALLKERNEL to select customized installkernel script 2009-09-20 12:18:14 +02:00
module.lds