mirror of https://github.com/torvalds/linux.git
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>
|
||
|---|---|---|
| .. | ||
| .gitignore | ||
| Makefile | ||
| apc.c | ||
| asm-offsets.c | ||
| audit.c | ||
| auxio_32.c | ||
| auxio_64.c | ||
| btext.c | ||
| central.c | ||
| cherrs.S | ||
| chmc.c | ||
| compat_audit.c | ||
| cpu.c | ||
| cpumap.c | ||
| cpumap.h | ||
| devices.c | ||
| dma.c | ||
| ds.c | ||
| dtlb_miss.S | ||
| dtlb_prot.S | ||
| ebus.c | ||
| entry.S | ||
| entry.h | ||
| etrap_32.S | ||
| etrap_64.S | ||
| fpu_traps.S | ||
| ftrace.c | ||
| getsetcc.S | ||
| head_32.S | ||
| head_64.S | ||
| helpers.S | ||
| hvapi.c | ||
| hvcalls.S | ||
| hvtramp.S | ||
| idprom.c | ||
| iommu.c | ||
| iommu_common.h | ||
| ioport.c | ||
| irq.h | ||
| irq_32.c | ||
| irq_64.c | ||
| itlb_miss.S | ||
| ivec.S | ||
| jump_label.c | ||
| kernel.h | ||
| kgdb_32.c | ||
| kgdb_64.c | ||
| kprobes.c | ||
| kstack.h | ||
| ktlb.S | ||
| ldc.c | ||
| led.c | ||
| leon_kernel.c | ||
| leon_pci.c | ||
| leon_pci_grpci1.c | ||
| leon_pci_grpci2.c | ||
| leon_pmc.c | ||
| leon_smp.c | ||
| mdesc.c | ||
| misctrap.S | ||
| module.c | ||
| nmi.c | ||
| of_device_32.c | ||
| of_device_64.c | ||
| of_device_common.c | ||
| of_device_common.h | ||
| pci.c | ||
| pci_common.c | ||
| pci_fire.c | ||
| pci_impl.h | ||
| pci_msi.c | ||
| pci_psycho.c | ||
| pci_sabre.c | ||
| pci_schizo.c | ||
| pci_sun4v.c | ||
| pci_sun4v.h | ||
| pci_sun4v_asm.S | ||
| pcic.c | ||
| pcr.c | ||
| perf_event.c | ||
| pmc.c | ||
| power.c | ||
| process_32.c | ||
| process_64.c | ||
| prom.h | ||
| prom_32.c | ||
| prom_64.c | ||
| prom_common.c | ||
| prom_irqtrans.c | ||
| psycho_common.c | ||
| psycho_common.h | ||
| ptrace_32.c | ||
| ptrace_64.c | ||
| reboot.c | ||
| rtrap_32.S | ||
| rtrap_64.S | ||
| sbus.c | ||
| setup_32.c | ||
| setup_64.c | ||
| signal32.c | ||
| signal_32.c | ||
| signal_64.c | ||
| sigutil.h | ||
| sigutil_32.c | ||
| sigutil_64.c | ||
| smp_32.c | ||
| smp_64.c | ||
| sparc_ksyms_32.c | ||
| sparc_ksyms_64.c | ||
| spiterrs.S | ||
| sstate.c | ||
| stacktrace.c | ||
| starfire.c | ||
| sun4d_irq.c | ||
| sun4d_smp.c | ||
| sun4m_irq.c | ||
| sun4m_smp.c | ||
| sun4v_ivec.S | ||
| sun4v_tlb_miss.S | ||
| sys32.S | ||
| sys_sparc32.c | ||
| sys_sparc_32.c | ||
| sys_sparc_64.c | ||
| syscalls.S | ||
| sysfs.c | ||
| systbls.h | ||
| systbls_32.S | ||
| systbls_64.S | ||
| time_32.c | ||
| time_64.c | ||
| trampoline_32.S | ||
| trampoline_64.S | ||
| traps_32.c | ||
| traps_64.c | ||
| tsb.S | ||
| ttable_32.S | ||
| ttable_64.S | ||
| una_asm_32.S | ||
| una_asm_64.S | ||
| unaligned_32.c | ||
| unaligned_64.c | ||
| utrap.S | ||
| vio.c | ||
| viohs.c | ||
| visemul.c | ||
| vmlinux.lds.S | ||
| windows.c | ||
| winfixup.S | ||
| wof.S | ||
| wuf.S | ||