android_kernel_motorola_sm6375/arch/sh
Repository files (latest commit first)
Filename Latest commit message Latest commit date
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 <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
CC: Richard Henderson <[email protected]>
CC: Ivan Kokshaysky <[email protected]>
CC: Matt Turner <[email protected]>
CC: David Howells <[email protected]>
CC: Tony Luck <[email protected]>
CC: Michal Simek <[email protected]>
CC: Ralf Baechle <[email protected]>
CC: Koichi Yasutake <[email protected]>
CC: Sebastian Ott <[email protected]>
CC: "David S. Miller" <[email protected]>
CC: Chris Metcalf <[email protected]>
CC: Chris Zankel <[email protected]>
CC: Max Filippov <[email protected]>
CC: Thomas Gleixner <[email protected]>
2015-03-19 10:17:13 -05:00
..
boards sh: eliminate unused irq_reg_{readl,writel} accessors 2015-02-10 14:30:28 -08:00
boot
cchips
configs PM: Eliminate CONFIG_PM_RUNTIME 2014-12-19 22:55:06 +01:00
drivers PCI: Assign resources before drivers claim devices (pci_scan_root_bus()) 2015-03-19 10:17:13 -05:00
include asm-generic: uaccess.h cleanup 2015-02-18 10:02:24 -08:00
kernel all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
lib sh: ftrace: Remove check of obsolete variable function_trace_stop 2014-07-18 13:57:04 -04:00
lib64
math-emu sh: remove unused do_fpu_error 2014-04-03 16:20:52 -07:00
mm Tighten rules for ACCESS_ONCE 2015-02-14 10:54:28 -08:00
oprofile
tools
Kconfig sh: build superh without CONFIG_EXPERT 2015-02-10 14:30:28 -08:00
Kconfig.cpu
Kconfig.debug
Makefile sh: also try passing -m4-nofpu for SH2A builds 2014-07-23 15:10:54 -07:00