]> git.baikalelectronics.ru Git - kernel.git/commit
swiotlb: Add restricted DMA alloc/free support
authorClaire Chang <tientzu@chromium.org>
Sat, 19 Jun 2021 03:40:40 +0000 (11:40 +0800)
committerKonrad Rzeszutek Wilk <konrad@kernel.org>
Wed, 14 Jul 2021 00:04:48 +0000 (20:04 -0400)
commit86267247d08a421b9347d03df3f7b66556f81f71
tree11895fa9fc7598998e67ac89eef18ee35e5f6b3b
parent75bdd1eddff7683efddf2aa37c57726cf2d600a9
swiotlb: Add restricted DMA alloc/free support

Add the functions, swiotlb_{alloc,free} and is_swiotlb_for_alloc to
support the memory allocation from restricted DMA pool.

The restricted DMA pool is preferred if available.

Note that since coherent allocation needs remapping, one must set up
another device coherent pool by shared-dma-pool and use
dma_alloc_from_dev_coherent instead for atomic coherent allocation.

Signed-off-by: Claire Chang <tientzu@chromium.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Stefano Stabellini <sstabellini@kernel.org>
Tested-by: Will Deacon <will@kernel.org>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
include/linux/swiotlb.h
kernel/dma/direct.c
kernel/dma/swiotlb.c