stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: dma-mapping: fix GFP_ATOMIC macro usage
@ 2014-01-17  8:46 Marek Szyprowski
  2014-01-17 10:49 ` Andy Whitcroft
  2014-01-24 13:53 ` [PATCH v2] " Marek Szyprowski
  0 siblings, 2 replies; 4+ messages in thread
From: Marek Szyprowski @ 2014-01-17  8:46 UTC (permalink / raw)
  To: linux-kernel, x86
  Cc: Marek Szyprowski, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	stable

GFP_ATOMIC is not a single gfp flag, but a macro which expands to the other
flags and LACK of __GFP_WAIT flag. To check if caller wanted to perform an
atomic allocation, the code must test __GFP_WAIT flag presence. This patch
fixes the issue introduced in v3.5-rc1

CC: stable@vger.kernel.org
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 arch/x86/kernel/pci-dma.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index 872079a..32a81c9 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -100,7 +100,7 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size,
 	flag |= __GFP_ZERO;
 again:
 	page = NULL;
-	if (!(flag & GFP_ATOMIC))
+	if (flag & __GFP_WAIT)
 		page = dma_alloc_from_contiguous(dev, count, get_order(size));
 	if (!page)
 		page = alloc_pages_node(dev_to_node(dev), flag, get_order(size));
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-24 13:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-17  8:46 [PATCH] x86: dma-mapping: fix GFP_ATOMIC macro usage Marek Szyprowski
2014-01-17 10:49 ` Andy Whitcroft
2014-01-20 10:25   ` Marek Szyprowski
2014-01-24 13:53 ` [PATCH v2] " Marek Szyprowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).