[PATCHv4 1/3] ARM: mm: use MT_UNCACHED as the memory type for PCI I/O mappings

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Thu May 15 07:59:32 PDT 2014

Arnd Bergmann explains: "The PCI I/O space semantics require
non-posted writes, which is the main difference between device and
strongly-ordered mappings."

This patch therefore changes the memory type used for PCI I/O mappings
from MT_DEVICE to MT_UNCACHED. On Marvell EBU platforms, it is part of
a workaround for a deadlock situation occuring on Armada 375/38x
between PCIe/PL310 and hardware I/O coherency in SMP situations.

As Arnd Bergmann indicates: "the same fix is required both for mvebu
as a workaround for the deadlock as well as for everyone else as a fix
for an incorrect PCI behavior."

Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
 arch/arm/mm/ioremap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index f9c32ba..631b0e6 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -445,7 +445,7 @@ int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr)
 	return ioremap_page_range(PCI_IO_VIRT_BASE + offset,
 				  PCI_IO_VIRT_BASE + offset + SZ_64K,
-				  __pgprot(get_mem_type(MT_DEVICE)->prot_pte));
+				  __pgprot(get_mem_type(MT_UNCACHED)->prot_pte));

More information about the linux-arm-kernel mailing list