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

Commit 2885148c authored by Sujit Reddy Thumma's avatar Sujit Reddy Thumma Committed by Gerrit - the friendly Code Review server
Browse files

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



This reverts commit 2c87f18c.
The assumption made in the original commit is that the buffer address
+ size of the request is always less than the PAGE_SIZE, which doesn't
hold true for with vmalloc'ed memory. Hence, revert the commit as the
original problem is fixed with bounce buffers.

Change-Id: Id14ebcf187a7aee0a8f5c0601975b55215644339
Signed-off-by: default avatarSujit Reddy Thumma <sthumma@codeaurora.org>
parent b0a4b7b3
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -433,13 +433,9 @@ 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 {
		page = vmalloc_to_page(addr);
		if (!page) {
			pr_err("%s: invalid addr 0x%lx\n",
				   __func__, (unsigned long)addr);
			WARN_ON(1);
		if (WARN_ON(size + offset > PAGE_SIZE))
			return ~0;
		}
		page = vmalloc_to_page(addr);
	}
	return dma_map_page(dev, page, offset, size, dir);
}