linux/drivers/pci/host
Thomas Petazzoni 31e45ec3a4 PCI: mvebu: Call pci_ioremap_io() at startup instead of dynamically
The mvebu PCI host controller driver uses an emulated PCI-to-PCI bridge to
leverage the core PCI kernel enumeration logic to dynamically create and
remove the MBus windows needed to access the memory and I/O regions of each
PCI interface.

In the context of this PCI-to-PCI bridge emulation, the driver emulates
all reads and writes to the PCI bridge registers.  Upon a write to the
registers configuring the I/O base and limit, the driver was creating the
MBus window and calling pci_ioremap_io() to setup the mapping.

However, it turns out that accesses to these registers are made in an IRQ
disabled context, while pci_ioremap_io() is a potentially sleeping
function.  Not only this is wrong, but it is causing fairly loud warnings
at boot time when the appropriate kernel hacking options are enabled.

This patch solves this by moving the pci_ioremap_io() call to the startup
of the driver.  At this point, we don't know how many PCI interfaces will
be enabled, so we are simply remapping the entire PCI I/O space to virtual
addresses.  This is reasonable since this I/O space is limited to 1 MB in
size, and also because the MBus windows continue to be created in a dynamic
fashion only when devices need them.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2014-01-02 14:36:24 -07:00
..
Kconfig PCI changes for the v3.13 merge window: 2013-11-14 14:02:00 +09:00
Makefile Merge branch 'pci/host-rcar' into next 2013-10-31 13:58:49 -06:00
pci-exynos.c PCI: exynos: Remove redundant of_match_ptr 2013-10-29 16:13:40 -06:00
pci-imx6.c PCI: imx6: Probe the PCIe in fs_initcall() 2013-10-31 11:34:04 -06:00
pci-mvebu.c PCI: mvebu: Call pci_ioremap_io() at startup instead of dynamically 2014-01-02 14:36:24 -07:00
pci-rcar-gen2.c PCI: Add R-Car Gen2 internal PCI support 2013-10-30 11:25:55 -06:00
pci-tegra.c PCI: Fix whitespace, capitalization, and spelling errors 2013-11-14 11:28:18 -07:00
pcie-designware.c PCI: Fix whitespace, capitalization, and spelling errors 2013-11-14 11:28:18 -07:00
pcie-designware.h PCI: designware: Add irq_create_mapping() 2013-10-09 09:14:23 -06:00