1
0
Fork 0

dma-direct: respect DMA_ATTR_NO_WARN

Respect the DMA_ATTR_NO_WARN flags for allocations in dma-direct.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Robin Murphy <robin.murphy@arm.com>
hifive-unleashed-5.1
Christoph Hellwig 2018-09-24 13:10:34 +02:00
parent 7ed1d91a9e
commit b9fd04262a
1 changed files with 3 additions and 0 deletions

View File

@ -114,6 +114,9 @@ void *dma_direct_alloc_pages(struct device *dev, size_t size,
u64 phys_mask;
void *ret;
if (attrs & DMA_ATTR_NO_WARN)
gfp |= __GFP_NOWARN;
/* we always manually zero the memory once we are done: */
gfp &= ~__GFP_ZERO;
gfp |= __dma_direct_optimal_gfp_mask(dev, dev->coherent_dma_mask,