Skip to content

Commit

Permalink
dma-direct: respect DMA_ATTR_NO_WARN
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig committed Oct 9, 2018
1 parent 7ed1d91 commit b9fd042
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/dma/direct.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b9fd042

Please sign in to comment.