2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-19 10:44:14 +08:00
linux-next/arch/sh/drivers/pci
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
..
common.c sh: Fix up early PCI PERR/SERR IRQ handling. 2010-02-03 16:46:20 +09:00
fixups-cayman.c PCI: Make the struct pci_dev * argument of pci_fixup_irqs const. 2011-07-22 08:26:06 -07:00
fixups-dreamcast.c sh/PCI: Pass GAPSPCI_DMA_BASE CPU & bus address to dma_declare_coherent_memory() 2014-05-20 16:55:39 -06:00
fixups-landisk.c sh: legacy PCI evt2irq migration. 2012-05-18 17:42:29 +09:00
fixups-r7780rp.c sh: legacy PCI evt2irq migration. 2012-05-18 17:42:29 +09:00
fixups-rts7751r2d.c PCI: Make the struct pci_dev * argument of pci_fixup_irqs const. 2011-07-22 08:26:06 -07:00
fixups-sdk7780.c sh: legacy PCI evt2irq migration. 2012-05-18 17:42:29 +09:00
fixups-sdk7786.c sh/PCI: adjust section annotations for pcibios_setup() 2012-07-05 15:09:13 -06:00
fixups-se7751.c sh: legacy PCI evt2irq migration. 2012-05-18 17:42:29 +09:00
fixups-sh03.c sh: legacy PCI evt2irq migration. 2012-05-18 17:42:29 +09:00
fixups-snapgear.c sh: legacy PCI evt2irq migration. 2012-05-18 17:42:29 +09:00
fixups-titan.c PCI: Make the struct pci_dev * argument of pci_fixup_irqs const. 2011-07-22 08:26:06 -07:00
Makefile sh: pci: Support slot 4 routing on SDK7786. 2010-10-14 07:37:01 +09:00
ops-dreamcast.c sh: pci: remove duplicated #include's 2009-06-14 17:48:43 +09:00
ops-sh4.c sh: pci: Use a generic raw spinlock for PCI config access locking. 2010-09-20 18:56:13 +09:00
ops-sh5.c sh: pci: Kill off legacy ide quirks. 2009-04-20 19:54:47 +09:00
ops-sh7786.c sh: pci: Use a generic raw spinlock for PCI config access locking. 2010-09-20 18:56:13 +09:00
pci-dreamcast.c sh: Improved multi-resource handling for SH7780 PCI. 2010-02-01 20:01:50 +09:00
pci-sh4.h sh: Kill off broken type 1 PCI config access checks. 2010-01-30 01:41:21 +09:00
pci-sh5.c SH: irq: Remove IRQF_DISABLED 2011-10-28 14:39:28 +09:00
pci-sh5.h sh: Mass ctrl_in/outX to __raw_read/writeX conversion. 2010-01-26 12:58:40 +09:00
pci-sh7751.c sh: Fix typos in PCI initialization message 2010-06-23 09:09:56 +01:00
pci-sh7751.h Fix common misspellings 2011-03-31 11:26:23 -03:00
pci-sh7780.c SH: pci-sh7780: enable big-endian operation. 2012-03-28 14:28:30 +09:00
pci-sh7780.h sh: pci: Move Renesas PCI IDs to a better place. 2010-09-20 15:37:25 +09:00
pci.c PCI: Assign resources before drivers claim devices (pci_scan_root_bus()) 2015-03-19 10:17:13 -05:00
pcie-sh7786.c async: rename and redefine async_func_ptr 2013-03-12 13:59:14 -07:00
pcie-sh7786.h arch/sh/drivers/pci/pcie-sh7786.h: remove duplicate SH4A_PCIEPHYCTLR 2014-04-03 16:20:53 -07:00