OSDN Git Service

swiotlb: refactor coherent buffer allocation
authorChristoph Hellwig <hch@lst.de>
Tue, 9 Jan 2018 21:15:30 +0000 (22:15 +0100)
committerChristoph Hellwig <hch@lst.de>
Mon, 15 Jan 2018 08:35:49 +0000 (09:35 +0100)
commit0176adb004065d6815a8e67946752df4cd947c5b
treee2e9a646e644709c854f4f9fdd3c1827bb796931
parenta25381aa3ae60a2e028c95f1318649b13cbbce30
swiotlb: refactor coherent buffer allocation

Factor out a new swiotlb_alloc_buffer helper that allocates DMA coherent
memory from the swiotlb bounce buffer.

This allows to simplify the swiotlb_alloc implemenation that uses
dma_direct_alloc to try to allocate a reachable buffer first.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Christian König <christian.koenig@amd.com>
lib/swiotlb.c