Skip to content

Commit

Permalink
ARM: 8427/1: dma-mapping: add support for offset parameter in dma_mmap()
Browse files Browse the repository at this point in the history
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>
Cc: stable@vger.kernel.org  # v3.6+
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Marek Szyprowski authored and Russell King committed Oct 3, 2015
1 parent 371f0f0 commit 7e31210
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/arm/mm/dma-mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,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) {
Expand Down

0 comments on commit 7e31210

Please sign in to comment.