Received: by 10.223.185.116 with SMTP id b49csp2862259wrg; Mon, 5 Mar 2018 09:51:50 -0800 (PST) X-Google-Smtp-Source: AG47ELvAv0g93lhi4948zEOX6bQ0maXNUprI7j3G/QCKVxHOvafQbh+r2jCjkm+fw4t9ZVGzHFKu X-Received: by 10.98.18.143 with SMTP id 15mr16296902pfs.104.1520272310642; Mon, 05 Mar 2018 09:51:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520272310; cv=none; d=google.com; s=arc-20160816; b=yj1UI0SIIEEYZ3Rh0uXiu9xwJXmTQrTpqzsE7/V3Mvq6RaLw8Fu9w0NWpMCH0LL35S hn4F12pQQavfyQeCwp7iD9baDDHgQci99c0svknwpVaO/QWl9B6yx5uRtfNFO0Fs1NQb uKE25PBt9PrEI8++NFrl+qMgO+ifcJ4pI/DuCXcv6Tqxknz8MjgqdepSVPWCO1JuUdCQ 6ybFR6pPQTFkFWJquJBOl6GzhBhM0ac0vo50evx+GNL/W6bYJ/W+9fMhQZyoICuSoSYP aLWuoXgUCCPbyaHKso4iRoi/KSpTVsSatexUGlzrQrO1OiTQw7v/dYKAjcfdQDPKlGC1 //Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Zq5DhGoW1a7elD21arNOEgCHstW7T/lP1FNWDMWwW6g=; b=SWQ1nZqO7NyvPWBTRjtN+VjcH5CUZJgtASYjcLStr6rSolYF1yfeJMf1qiHN8lfsfx C2plQa9NhTdNGmIZW4PwqZOBuFiqOr01v4oI7OfqAla2DRCp/tkqg177/HXE3pDHFB4d WWcIN6KwcJB3q89UWw4TNm2pAHVmMeRJHIBwYtM+lwThDvqBI1KmGbG83X3hJynGYdks lENJn/ucbxF7k3OqzGiN2gIFoOj/iQDfAopW8/Jj+YVDTLitIf/56leTlxiZ2g/sbfb4 xc3piQPM6+7XHHx6qgy7acHogLDYjLiYFMp5NAulozDWK3cFmA6H5jNgFrjV0/7uDr1T OL3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=kruYGKBy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d14si8598274pgn.306.2018.03.05.09.51.36; Mon, 05 Mar 2018 09:51:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=kruYGKBy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932505AbeCERtm (ORCPT + 99 others); Mon, 5 Mar 2018 12:49:42 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:60276 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752578AbeCERrO (ORCPT ); Mon, 5 Mar 2018 12:47:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Zq5DhGoW1a7elD21arNOEgCHstW7T/lP1FNWDMWwW6g=; b=kruYGKBy7sz2eIOE9mfdNh8sj oyw6achwxD4bEQ0Ys7CMEl7pU2z+tAOkm1YPI73E2XwGtMblotDP7ds/Sr2rXkvlOw0I9Iy7899Wn K7LFqWeInKTZwPURYaFLklRBExgAFjTCv7Sf08dGBC6O+v2IbVviRD8dcys9tBVQ1cGUs6XEUjir6 fHK0/oXzOoPtOCAfihBF+sWpx0DhDguqVoSofetRQera4iMT0NGrvBZZGwJyu5mJ7VfoHx3nXsJpM q8E7UPlr4zlWi0qTm7oyvPol18duhRtd/M084yfEVBvV41fm5YjLv14FMCAEnSJVkYdm8OCThM9tw rxTde6AXg==; Received: from [209.116.154.70] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1esuCS-0002tR-ML; Mon, 05 Mar 2018 17:47:00 +0000 From: Christoph Hellwig To: x86@kernel.org Cc: Konrad Rzeszutek Wilk , Tom Lendacky , David Woodhouse , Muli Ben-Yehuda , Jon Mason , Joerg Roedel , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/13] x86/amd_gart: look at coherent_dma_mask instead of GFP_DMA Date: Mon, 5 Mar 2018 09:46:47 -0800 Message-Id: <20180305174655.9878-6-hch@lst.de> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180305174655.9878-1-hch@lst.de> References: <20180305174655.9878-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 coherent_dma_mask instead, which is used to select the GFP_DMA flag in the caller. Signed-off-by: Christoph Hellwig --- 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) -- 2.14.2