diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-02-20 20:58:56 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-02-20 20:58:56 +0100 |
commit | d49649615d3673ec94139fbd0918fb13949a1d8b (patch) | |
tree | ced3194db6057c5bafee503465f2fb63d96e293a /arch/x86 | |
parent | user_namespace.c: Remove duplicated word in comment (diff) | |
parent | x86: dma-mapping: fix GFP_ATOMIC macro usage (diff) | |
download | linux-d49649615d3673ec94139fbd0918fb13949a1d8b.tar.xz linux-d49649615d3673ec94139fbd0918fb13949a1d8b.zip |
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
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/pci-dma.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index 872079a67e4d..f7d0672481fd 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c @@ -100,8 +100,10 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size, flag |= __GFP_ZERO; again: 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)); + /* fallback */ if (!page) page = alloc_pages_node(dev_to_node(dev), flag, get_order(size)); if (!page) |