linux_dsm_epyc7002/arch/xtensa/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
..
.gitignore xtensa: tell git to ignore generated files 2013-06-05 10:14:19 -07:00
align.S xtensa: allow single-stepping through unaligned load/store 2014-08-14 11:59:30 +04:00
asm-offsets.c xtensa: add support for TLS 2013-02-23 19:35:57 -08:00
coprocessor.S xtensa: keep a3 and excsave1 on entry to exception handlers 2013-09-06 09:47:41 -07:00
entry.S xtensa: deprecate fast_xtensa and fast_spill_registers syscalls 2014-08-14 11:59:33 +04:00
head.S xtensa: move vecbase SR initialization to _startup 2014-10-21 13:28:55 +04:00
irq.c xtensa: Use irq_set_affinity instead of homebrewn code 2014-03-04 17:37:55 +01:00
Makefile xtensa: add SMP support 2014-01-14 10:19:58 -08:00
mcount.S xtensa: add static function tracer support 2013-07-08 01:18:57 -07:00
module.c xtensa: clean up files to make them code-style compliant 2012-12-18 21:10:25 -08:00
mxhead.S xtensa: add SMP support 2014-01-14 10:19:58 -08:00
pci-dma.c xtensa: fix address checks in dma_{alloc,free}_coherent 2014-08-14 11:59:14 +04:00
pci.c PCI: Assign resources before drivers claim devices (pci_scan_root_bus()) 2015-03-19 10:17:13 -05:00
platform.c xtensa: cleanup ccount frequency tracking 2013-07-08 01:11:37 -07:00
process.c xtensa: Use generic idle loop 2013-04-08 17:39:29 +02:00
ptrace.c ARCH: AUDIT: audit_syscall_entry() should not require the arch 2014-09-23 16:21:26 -04:00
setup.c xtensa: use %*pb[l] to print bitmaps including cpumasks and nodemasks 2015-02-13 21:21:37 -08:00
signal.c all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
smp.c flush_icache_range: export symbol to fix build errors 2014-08-29 16:28:17 -07:00
stacktrace.c xtensa: provide custom CALLER_ADDR* implementations 2013-05-09 01:07:10 -07:00
syscall.c xtensa: nommu: don't provide arch_get_unmapped_area 2014-10-21 13:28:48 +04:00
time.c xtensa: export ccount_freq 2014-01-19 20:00:48 +04:00
traps.c xtensa: don't allow overflow/underflow on unaligned stack 2014-08-14 11:59:32 +04:00
vectors.S xtensa: don't allow overflow/underflow on unaligned stack 2014-08-14 11:59:32 +04:00
vmlinux.lds.S xtensa: don't allow overflow/underflow on unaligned stack 2014-08-14 11:59:32 +04:00
xtensa_ksyms.c xtensa: export __{invalidate,flush}_dcache_range 2014-04-02 01:35:50 +04:00