linux/arch/ia64/sn/kernel
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
..
sn2 ia64: Replace __get_cpu_var uses 2014-08-26 13:45:52 -04:00
Makefile ia64: change to new flag variables 2011-03-17 14:02:56 +01:00
bte.c [IA64] sn: Do not needlessly convert between pointers and integers 2014-07-29 16:28:15 -07:00
bte_error.c [IA64] Fix Altix BTE error return status 2007-12-19 11:19:19 -08:00
huberror.c [IA64] genirq fixup for SGI/SN 2012-02-22 11:11:06 -08:00
idle.c
io_acpi_init.c ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node 2013-11-14 23:14:43 +01:00
io_common.c IA64: drivers: remove __dev* attributes. 2013-01-03 15:57:13 -08:00
io_init.c PCI: Assign resources before drivers claim devices (pci_scan_root_bus()) 2015-03-19 10:17:13 -05:00
iomv.c [IA64] Move include/asm-ia64 to arch/ia64/include/asm 2008-08-01 10:21:21 -07:00
irq.c ia64: Validate online cpus in irq_set_affinity() callbacks 2014-03-12 13:07:40 +01:00
klconflib.c [IA64-SGI] sn2 housekeeping 2006-02-02 13:35:59 -08:00
machvec.c
mca.c [IA64] remove remaining __FUNCTION__ occurrences 2008-03-06 09:19:27 -08:00
msi_sn.c PCI/MSI: Rename mask/unmask_msi_irq treewide 2014-11-23 13:01:45 +01:00
pio_phys.S [IA64-SGI] - Eliminate SN pio_phys_xxx macros. Move to assembly 2006-02-07 09:24:14 -08:00
setup.c ia64: sn_nodepda cannot be assigned to after this_cpu conversion. Use __this_cpu_write. 2014-09-02 11:52:36 -04:00
tiocx.c tiocx: check retval from bus_register() 2013-03-19 16:14:52 -07:00