]> git.baikalelectronics.ru Git - kernel.git/commit
dma-mapping: postpone cpu addr translation on mmap
authorJacopo Mondi <jacopo+renesas@jmondi.org>
Fri, 13 Apr 2018 17:25:37 +0000 (19:25 +0200)
committerChristoph Hellwig <hch@lst.de>
Mon, 23 Apr 2018 12:44:24 +0000 (14:44 +0200)
commitb0112c008b4f9e607d55b00aa16af199d916ddc5
tree8d8c20c6897285ee5cc68e3dfef0e21ae2378ae9
parentb8e7d5b633c56b0355dc395ee52cb539f5f445a5
dma-mapping: postpone cpu addr translation on mmap

Postpone calling virt_to_page() translation on memory locations not
guaranteed to be backed by a struct page.  Try first to map memory from
the device coherent memory pool, then perform translation if that fails.

On some architectures, specifically SH when configured with the SPARSEMEM
memory model, assuming a struct page is always assigned to a memory
address lead to unexpected hangs during the virtual to page address
translation. This patch fixes that specific issue but applies in the
general case too.

Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/base/dma-mapping.c