dma-direct: respect DMA_ATTR_NO_WARN
authorChristoph Hellwig <hch@lst.de>
Mon, 24 Sep 2018 11:10:34 +0000 (13:10 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 9 Oct 2018 13:08:46 +0000 (15:08 +0200)
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>
kernel/dma/direct.c

index a5a943836c8ee1ef100d248a035602967b8a1875..87a6bc2a96c0c46ac422fbf77f6ca63803752c74 100644 (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,