public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Junichi Nomura <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tony.luck@intel.com, mingo@kernel.org, hch@lst.de,
	linux-kernel@vger.kernel.org, hpa@zytor.com,
	j-nomura@ce.jp.nec.com, tglx@linutronix.de
Subject: [tip:x86/urgent] x86/pci/dma: Fix gfp flags for coherent DMA memory allocation
Date: Thu, 17 Sep 2015 07:27:47 -0700	[thread overview]
Message-ID: <tip-590f07874e8e3c83729b919312c65aea2533c8cf@git.kernel.org> (raw)
In-Reply-To: <20150914073834.GA13077@xzibit.linux.bs1.fc.nec.co.jp>

Commit-ID:  590f07874e8e3c83729b919312c65aea2533c8cf
Gitweb:     http://git.kernel.org/tip/590f07874e8e3c83729b919312c65aea2533c8cf
Author:     Junichi Nomura <j-nomura@ce.jp.nec.com>
AuthorDate: Mon, 14 Sep 2015 07:38:36 +0000
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 17 Sep 2015 16:22:11 +0200

x86/pci/dma: Fix gfp flags for coherent DMA memory allocation

Commit 6894258eda2f reversed the order of gfp_flags adjustment in
dma_alloc_attrs() for x86 [arch/x86/kernel/pci-dma.c] As a result,
relevant flags set by dma_alloc_coherent_gfp_flags() are just
discarded and cause coherent DMA memory allocation failure on some
devices.

Fixes: 6894258eda2f ("dma-mapping: consolidate dma_{alloc,free}_{attrs,coherent}")
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Tested-by: Tony Luck <tony.luck@intel.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Link: http://lkml.kernel.org/r/20150914073834.GA13077@xzibit.linux.bs1.fc.nec.co.jp
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 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 84b8ef8..1b55de1 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -131,8 +131,8 @@ void dma_generic_free_coherent(struct device *dev, size_t size, void *vaddr,
 
 bool arch_dma_alloc_attrs(struct device **dev, gfp_t *gfp)
 {
-	*gfp = dma_alloc_coherent_gfp_flags(*dev, *gfp);
 	*gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
+	*gfp = dma_alloc_coherent_gfp_flags(*dev, *gfp);
 
 	if (!*dev)
 		*dev = &x86_dma_fallback_dev;

      parent reply	other threads:[~2015-09-17 14:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-14  7:38 [PATCH] x86: Fix gfp flags for coherent DMA memory allocation Junichi Nomura
2015-09-15  9:36 ` Junichi Nomura
2015-09-16 21:47 ` Tony Luck
2015-09-17  0:04 ` Christoph Hellwig
2015-09-17 14:27 ` tip-bot for Junichi Nomura [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-590f07874e8e3c83729b919312c65aea2533c8cf@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hch@lst.de \
    --cc=hpa@zytor.com \
    --cc=j-nomura@ce.jp.nec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox