ARM: 8347/1: dma-mapping: fix off-by-one check in arm_setup_iommu_dma_ops
authorMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 29 Apr 2015 10:29:19 +0000 (11:29 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 3 May 2015 22:21:55 +0000 (23:21 +0100)
commit1424532b2163bf1580f4b1091a5801e12310fac5
tree660249983a3f4cf6b190fa99cd9e44703b60a3b0
parentb787f68c36d49bb1d9236f403813641efa74a031
ARM: 8347/1: dma-mapping: fix off-by-one check in arm_setup_iommu_dma_ops

Patch 22b3c181c6c324a46f71aae806d8ddbe61d25761 ("arm: dma-mapping: limit
IOMMU mapping size") added a check for IO address space size. However
this patch broke IOMMU initialization for typical platforms initialized
from device tree, which get the default IO address space size of 4GiB.
This value doesn't fit into size_t and fails a check introduced by that
commit resulting in failed dma-mapping/iommu initialization. This patch
fixes this issue by adding proper support for full 4GiB address space
size.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/dma-iommu.h
arch/arm/mm/dma-mapping.c