Received: by 10.213.65.68 with SMTP id h4csp1418025imn; Mon, 19 Mar 2018 03:44:22 -0700 (PDT) X-Google-Smtp-Source: AG47ELsG3sh2KJBxgmDRogtCETKDFG7ddOhsU41gX0ROVE47Wgq6ir/c3ijJLk9pskAN3M0itUkD X-Received: by 10.99.97.203 with SMTP id v194mr8681024pgb.373.1521456261940; Mon, 19 Mar 2018 03:44:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521456261; cv=none; d=google.com; s=arc-20160816; b=ci4btekV6pDhsWv29R2M5fmHSmyRcx4dnR1dv55gQWpn1b3vaN8PP4xCcg7WEiqHf1 +x5Pne8nZKQ3LzFaAw2HabVrU4EU46583hyhC4nbDqawxGAsLuqjCixaTZPvXWJGyd98 qBfs4XtiTXDurdvETbks5SLXrn62imghq3CCFAngk8glu7Va6tJr1gt7FbUF3OKVLO9U d0Vd4w/97SjSupxWwEEq1GynxVe/gJfSPmM649Wv0PB6pPgqKerwufxJkqoZ7/RstQoN SCpEFyykmrDnu35/NO7ulEb7PngG+Ken9BqywqOyVSqqHi/0T9MB3W3bern9jozrjtww Ez/g== 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=Nr3rMOrLp1bBFoQtusLUBLzE2mEXvEl2P7WqKF9Mfhw=; b=Q8AI5ngTFH2TRXVsz0D6ULKBs9rIrzydSw6QiQ0jFkWaMtq194K/qNHBgAaHV13rQQ hq7Vfbyuej7V/MvWoNRKuwsoKP/do+Y+GsoGaKmDzj8ghXELVGDwNZFu30syPh9Jb04z r8GkQ70dxuHy90rcoYEvKbFe6fSS+2iTT0Wwn7bFXR7mzDAfSf37lB/T5MG5j+nz+UsV CDR5pe5KYAJTXVDikMudg8lRUj4kqENFmT9UZvqJdP8ZQa2tnadN+cah8tGcS5vEf84W MtCzd0r/VeJAiVdN1vQSH1TEOMCdcmmjXw/oU6XN003D4bDJWtbV4EESYlUCE4dqnP9X kEQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=mcJexpE6; 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 x12-v6si1836214plo.129.2018.03.19.03.44.07; Mon, 19 Mar 2018 03:44:21 -0700 (PDT) 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=mcJexpE6; 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 S933000AbeCSKmW (ORCPT + 99 others); Mon, 19 Mar 2018 06:42:22 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:55058 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932838AbeCSKiz (ORCPT ); Mon, 19 Mar 2018 06:38:55 -0400 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=Nr3rMOrLp1bBFoQtusLUBLzE2mEXvEl2P7WqKF9Mfhw=; b=mcJexpE6wlFb5thXc31m1DTbL xUg842boXRxD7hgpkH9rw49Z5cKS+TXOXcYbCI1Db1wYmxxGSfRXPb5UCQihkJ/jG7WSzO5eFI4Fd l1yzCYAj+BXXMwmFf3zyjcZM5E3NU3WUe1MR3rvT77lXQU9xPEgKRApv0IN5a5ItzkinbHzsDsG0Q /ZlubTVG4oTVmdNGLnIa4LTt54i1S1D0zQMza3JKozMiYO+Ekw6U1wTCrqCJqVtU6dR/q7bfaTDIw 7WTsexgg4Vc89RNSNofGctACKlfuyC9EX/DXeJhB5oprO+ZaEDFDky8AlTuO8ktH0t2m2KhVBpHAV 3LmdW1NUA==; Received: from 178.114.187.156.wireless.dyn.drei.com ([178.114.187.156] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1exsBj-0005nj-JX; Mon, 19 Mar 2018 10:38:48 +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/14] x86/amd_gart: look at coherent_dma_mask instead of GFP_DMA Date: Mon, 19 Mar 2018 11:38:17 +0100 Message-Id: <20180319103826.12853-6-hch@lst.de> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180319103826.12853-1-hch@lst.de> References: <20180319103826.12853-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 Reviewed-by: Konrad Rzeszutek Wilk --- 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