From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752088AbbIQO2K (ORCPT ); Thu, 17 Sep 2015 10:28:10 -0400 Received: from terminus.zytor.com ([198.137.202.10]:33273 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751882AbbIQO2I (ORCPT ); Thu, 17 Sep 2015 10:28:08 -0400 Date: Thu, 17 Sep 2015 07:27:47 -0700 From: tip-bot for Junichi Nomura Message-ID: 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 Reply-To: 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 In-Reply-To: <20150914073834.GA13077@xzibit.linux.bs1.fc.nec.co.jp> References: <20150914073834.GA13077@xzibit.linux.bs1.fc.nec.co.jp> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/pci/dma: Fix gfp flags for coherent DMA memory allocation Git-Commit-ID: 590f07874e8e3c83729b919312c65aea2533c8cf X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 590f07874e8e3c83729b919312c65aea2533c8cf Gitweb: http://git.kernel.org/tip/590f07874e8e3c83729b919312c65aea2533c8cf Author: Junichi Nomura AuthorDate: Mon, 14 Sep 2015 07:38:36 +0000 Committer: Thomas Gleixner 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 Tested-by: Tony Luck Acked-by: Christoph Hellwig Link: http://lkml.kernel.org/r/20150914073834.GA13077@xzibit.linux.bs1.fc.nec.co.jp Signed-off-by: Thomas Gleixner --- 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;