dma-direct: we might need GFP_DMA for 32-bit dma masks
authorChristoph Hellwig <hch@lst.de>
Wed, 13 Feb 2019 07:01:03 +0000 (08:01 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 18 Feb 2019 11:41:01 +0000 (22:41 +1100)
If there is no ZONE_DMA32 we might need GFP_DMA to be able to
allocate memory that satisfies a 32-bit DMA mask.

Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
kernel/dma/direct.c

index 355d16acee6dd17aa7998d1ea55a6abcb3e01e92..d5bb51cf27c6543102265123e9887e42722e4fa1 100644 (file)
@@ -132,8 +132,7 @@ again:
                        goto again;
                }
 
-               if (IS_ENABLED(CONFIG_ZONE_DMA) &&
-                   phys_mask < DMA_BIT_MASK(32) && !(gfp & GFP_DMA)) {
+               if (IS_ENABLED(CONFIG_ZONE_DMA) && !(gfp & GFP_DMA)) {
                        gfp = (gfp & ~GFP_DMA32) | GFP_DMA;
                        goto again;
                }