summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2015-08-28 09:42:09 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-12-09 13:40:07 -0500
commit1aac1dc9886764cfa1226273e4d4709284872442 (patch)
tree6f8a9181cda9f14d6c3accbca10a6859690dcb2a /arch
parent98cc6d31fa7dde7beb1bccc51ad5c858d9ae5b04 (diff)
downloadlinux-stable-1aac1dc9886764cfa1226273e4d4709284872442.tar.gz
linux-stable-1aac1dc9886764cfa1226273e4d4709284872442.tar.bz2
linux-stable-1aac1dc9886764cfa1226273e4d4709284872442.zip
ARM: 8427/1: dma-mapping: add support for offset parameter in dma_mmap()
commit 7e31210349e9e03a9a4dff31ab5f2bc83e8e84f5 upstream. IOMMU-based dma_mmap() implementation lacked proper support for offset parameter used in mmap call (it always assumed that mapping starts from offset zero). This patch adds support for offset parameter to IOMMU-based implementation. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mm/dma-mapping.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index ac2b6b894320..1a00c33a5b7e 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -1366,6 +1366,8 @@ static int arm_iommu_mmap_attrs(struct device *dev, struct vm_area_struct *vma,
if (off >= nr_pages || (usize >> PAGE_SHIFT) > nr_pages - off)
return -ENXIO;
+ pages += off;
+
do {
int ret = vm_insert_page(vma, uaddr, *pages++);
if (ret) {