Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c87f18c authored by Tatyana Brokhman's avatar Tatyana Brokhman
Browse files

mtd: msm_qpic_nand: Don't restrict dma mapping to page boundaries



With the current implementation the nand driver is restricting
itself while doing dma mapping. The hardware wouldn’t know anything
about the kernel page frame organization and the BAM should be able
to access the memory at any boundary.

CRs-fixed: 614187
Change-Id: I9e3d0df1ccbecbe641f3105ab9857140cff9a8e7
Signed-off-by: default avatarSujit Reddy Thumma <sthumma@codeaurora.org>
Signed-off-by: default avatarTatyana Brokhman <tlinder@codeaurora.org>
parent 43ccce02
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -415,9 +415,13 @@ static dma_addr_t msm_nand_dma_map(struct device *dev, void *addr, size_t size,
	if (virt_addr_valid(addr))
		page = virt_to_page(addr);
	else {
		if (WARN_ON(size + offset > PAGE_SIZE))
			return ~0;
		page = vmalloc_to_page(addr);
		if (!page) {
			pr_err("%s: invalid addr 0x%lx\n",
				   __func__, (unsigned long)addr);
			WARN_ON(1);
			return ~0;
		}
	}
	return dma_map_page(dev, page, offset, size, dir);
}