|
@@ -255,9 +255,11 @@ static inline unsigned long dma_alloc_coherent_mask(struct device *dev,
|
|
|
|
|
|
static inline gfp_t dma_alloc_coherent_gfp_flags(struct device *dev, gfp_t gfp)
|
|
static inline gfp_t dma_alloc_coherent_gfp_flags(struct device *dev, gfp_t gfp)
|
|
{
|
|
{
|
|
-#ifdef CONFIG_X86_64
|
|
|
|
unsigned long dma_mask = dma_alloc_coherent_mask(dev, gfp);
|
|
unsigned long dma_mask = dma_alloc_coherent_mask(dev, gfp);
|
|
|
|
|
|
|
|
+ if (dma_mask <= DMA_24BIT_MASK)
|
|
|
|
+ gfp |= GFP_DMA;
|
|
|
|
+#ifdef CONFIG_X86_64
|
|
if (dma_mask <= DMA_32BIT_MASK && !(gfp & GFP_DMA))
|
|
if (dma_mask <= DMA_32BIT_MASK && !(gfp & GFP_DMA))
|
|
gfp |= GFP_DMA32;
|
|
gfp |= GFP_DMA32;
|
|
#endif
|
|
#endif
|