Skip to content
Commit 95375f2a authored by Thomas Petazzoni's avatar Thomas Petazzoni Committed by Bjorn Helgaas
Browse files

PCI: mvebu: Fix PCI I/O mapping creation sequence



Commit ee160438 ("PCI: mvebu: Only remap I/O space if configured") had
the side effect that the PCI I/O mapping was created much earlier than
before, at a point where the probe() of the driver could still fail. This
is for example a problem if one gets an -EPROBE_DEFER at some point during
probe(), after pci_ioremap_io() has been called.

Indeed, there is currently no function to undo what pci_ioremap_io() did,
and switching to pci_remap_iospace() is not an option in pci-mvebu due to
the need for special memory attributes on Armada 38x.

Reverting ee160438 ("PCI: mvebu: Only remap I/O space if configured")
would be a possibility, but it would require also reverting 42342073
("PCI: mvebu: Convert to use pci_host_bridge directly"). So instead, we use
an open-coded version of pci_host_probe() that creates the PCI I/O mapping
at a point where we are guaranteed not to fail anymore.

Fixes: ee160438 ("PCI: mvebu: Only remap I/O space if configured")
Reported-by: default avatarJan Kundrát <jan.kundrat@cesnet.cz>
Tested-by: default avatarJan Kundrát <jan.kundrat@cesnet.cz>
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
parent 573bcd38
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment