]> git.baikalelectronics.ru Git - kernel.git/commit
dma-mapping: implement dma_map_single_attrs using dma_map_page_attrs
authorChristoph Hellwig <hch@lst.de>
Tue, 25 Dec 2018 07:50:35 +0000 (08:50 +0100)
committerChristoph Hellwig <hch@lst.de>
Fri, 4 Jan 2019 08:02:17 +0000 (09:02 +0100)
commit2f50903bc2696f31c64dd2b5878c17fc294b91e5
treee88e6506cf6ad38bd2ad3d764a20290dbf0b6818
parenta32c85b4fad3ede9db6ad279c72f9c1e4cd95263
dma-mapping: implement dma_map_single_attrs using dma_map_page_attrs

And also switch the way we implement the unmap side around to stay
consistent.  This ensures dma-debug works again because it records which
function we used for mapping to ensure it is also used for unmapping,
and also reduces further code duplication.  Last but not least this
also officially allows calling dma_sync_single_* for mappings created
using dma_map_page, which is perfectly fine given that the sync calls
only take a dma_addr_t, but not a virtual address or struct page.

Fixes: a2ec96386f ("dma-mapping: merge dma_unmap_page_attrs and dma_unmap_single_attrs")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: LABBE Corentin <clabbe.montjoie@gmail.com>
include/linux/dma-debug.h
include/linux/dma-mapping.h
kernel/dma/debug.c