mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-12 08:00:09 +00:00
Merge branch 'fixes-for-v3.14' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping
Pull DMA-mapping fixes from Marek Szyprowski: "This contains fixes for incorrect atomic test in dma-mapping subsystem for ARM and x86 architecture" * 'fixes-for-v3.14' of git://git.linaro.org/people/mszyprowski/linux-dma-mapping: x86: dma-mapping: fix GFP_ATOMIC macro usage ARM: dma-mapping: fix GFP_ATOMIC macro usage
This commit is contained in:
commit
d49649615d
@ -1358,7 +1358,7 @@ static void *arm_iommu_alloc_attrs(struct device *dev, size_t size,
|
|||||||
*handle = DMA_ERROR_CODE;
|
*handle = DMA_ERROR_CODE;
|
||||||
size = PAGE_ALIGN(size);
|
size = PAGE_ALIGN(size);
|
||||||
|
|
||||||
if (gfp & GFP_ATOMIC)
|
if (!(gfp & __GFP_WAIT))
|
||||||
return __iommu_alloc_atomic(dev, size, handle);
|
return __iommu_alloc_atomic(dev, size, handle);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -100,8 +100,10 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size,
|
|||||||
flag |= __GFP_ZERO;
|
flag |= __GFP_ZERO;
|
||||||
again:
|
again:
|
||||||
page = NULL;
|
page = NULL;
|
||||||
if (!(flag & GFP_ATOMIC))
|
/* CMA can be used only in the context which permits sleeping */
|
||||||
|
if (flag & __GFP_WAIT)
|
||||||
page = dma_alloc_from_contiguous(dev, count, get_order(size));
|
page = dma_alloc_from_contiguous(dev, count, get_order(size));
|
||||||
|
/* fallback */
|
||||||
if (!page)
|
if (!page)
|
||||||
page = alloc_pages_node(dev_to_node(dev), flag, get_order(size));
|
page = alloc_pages_node(dev_to_node(dev), flag, get_order(size));
|
||||||
if (!page)
|
if (!page)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user