From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752488AbeCWTul (ORCPT ); Fri, 23 Mar 2018 15:50:41 -0400 Received: from terminus.zytor.com ([198.137.202.136]:60841 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751864AbeCWTuj (ORCPT ); Fri, 23 Mar 2018 15:50:39 -0400 Date: Fri, 23 Mar 2018 12:50:12 -0700 From: tip-bot for Christoph Hellwig Message-ID: Cc: thomas.lendacky@amd.com, konrad.wilk@oracle.com, mulix@mulix.org, dwmw2@infradead.org, hch@lst.de, peterz@infradead.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, hpa@zytor.com, joro@8bytes.org, mingo@kernel.org, torvalds@linux-foundation.org, jdmason@kudzu.us Reply-To: peterz@infradead.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, hpa@zytor.com, joro@8bytes.org, mingo@kernel.org, torvalds@linux-foundation.org, jdmason@kudzu.us, thomas.lendacky@amd.com, konrad.wilk@oracle.com, mulix@mulix.org, dwmw2@infradead.org, hch@lst.de In-Reply-To: <20180319103826.12853-6-hch@lst.de> References: <20180319103826.12853-6-hch@lst.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/dma] x86/dma/amd_gart: Look at dev->coherent_dma_mask instead of GFP_DMA Git-Commit-ID: f3c39d51043dcee5dd4d51dffcfe9ce01a263582 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: f3c39d51043dcee5dd4d51dffcfe9ce01a263582 Gitweb: https://git.kernel.org/tip/f3c39d51043dcee5dd4d51dffcfe9ce01a263582 Author: Christoph Hellwig AuthorDate: Mon, 19 Mar 2018 11:38:17 +0100 Committer: Ingo Molnar CommitDate: Tue, 20 Mar 2018 10:01:57 +0100 x86/dma/amd_gart: Look at dev->coherent_dma_mask instead of GFP_DMA We want to phase out looking at the magic GFP_DMA flag in the DMA mapping routines, so switch the gart driver to use the dev->coherent_dma_mask instead, which is used to select the GFP_DMA flag in the caller. Tested-by: Tom Lendacky Signed-off-by: Christoph Hellwig Reviewed-by: Thomas Gleixner Reviewed-by: Konrad Rzeszutek Wilk Cc: David Woodhouse Cc: Joerg Roedel Cc: Jon Mason Cc: Linus Torvalds Cc: Muli Ben-Yehuda Cc: Peter Zijlstra Cc: iommu@lists.linux-foundation.org Link: http://lkml.kernel.org/r/20180319103826.12853-6-hch@lst.de Signed-off-by: Ingo Molnar --- arch/x86/kernel/amd_gart_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/amd_gart_64.c b/arch/x86/kernel/amd_gart_64.c index 52e3abcf3e70..79ac6caaaabb 100644 --- a/arch/x86/kernel/amd_gart_64.c +++ b/arch/x86/kernel/amd_gart_64.c @@ -484,7 +484,7 @@ gart_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_addr, unsigned long align_mask; struct page *page; - if (force_iommu && !(flag & GFP_DMA)) { + if (force_iommu && dev->coherent_dma_mask > DMA_BIT_MASK(24)) { flag &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32); page = alloc_pages(flag | __GFP_ZERO, get_order(size)); if (!page)