Received: by 10.213.65.68 with SMTP id h4csp662703imn; Fri, 23 Mar 2018 12:52:31 -0700 (PDT) X-Google-Smtp-Source: AG47ELtCHDKnqfaJ/NM6X2/9R8HV5GElMvyjXPJtK0X3a4cfhbGSZoPuKPMVdHEqG5FnR+5Cpqyr X-Received: by 2002:a17:902:7502:: with SMTP id i2-v6mr13722921pll.220.1521834751399; Fri, 23 Mar 2018 12:52:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521834751; cv=none; d=google.com; s=arc-20160816; b=dRQ/B52mbClIxxeiVreWFivO3AMpIISf3R+/HvbK6gk0DDvXQZWIcu2P4euTRm/gEf FkAMHf1cpIaD6zdIG9yOTYTWqwWzPRZIeZOh+T+Us9B67Lud9xuixUHzrSk3BEwxNFDE jdiB6EnRnO1LRJcuVdKF6YFD+lLDYzWzNjc1BBOw8ee3f5wETaVng2XM05HMU8kHfsTj Qt8IIT89wuY6J/TiU4huIui6EWKZjiXBpHjG/3PrLRM8EFGdu3g7TyKO5IL/RKjr0Yf0 R4mFUjvWmYy/OyIU8gc2WWUtafxKq8NNjQAUOacyd4X+D0JD7RJVz8rDQE+s048F8v5X JN7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=yAxgXnM6SxeEmud8lDDC2OzOKq/AIAtn4Yb9MUzfjSw=; b=gp8XpGVxSXcVdbBVYo7eS/O5+3jiKc4YSC2i6QvRDH2qKf3yuQ7zEfxWe+zBJAVs+N 45tVIch4zFJU1mr3izAA2fQYz/XHzYbCfbPMHpCSWttCsZCrY5Eac77KA2tI3gnSt14X +cbTdq8bK0Lmp3w5zCYd97p+0m3E8a6+a6Gpgb4UzP+x/gdLSRh9qyHsluFejOXBMs3h sHirr4kxLa0CEA0iLU6DD5xfvOfeoHQeBVTP7nh/0fHh9M9Psl7TZsuzCyAfsEdMHuZM +EiTU/ddEvbe9FS3csngXxyksrVWpA2crRjRpGU0PGVvQ5WkVOINsAOULGvQtGswKauD lXtA== ARC-Authentication-Results: i=1; mx.google.com; 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 92-v6si9079737plc.713.2018.03.23.12.52.16; Fri, 23 Mar 2018 12:52:31 -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; 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 S1752486AbeCWTul (ORCPT + 99 others); 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 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w2NJoCgw019543; Fri, 23 Mar 2018 12:50:12 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w2NJoCvV019540; Fri, 23 Mar 2018 12:50:12 -0700 Date: Fri, 23 Mar 2018 12:50:12 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f 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 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk 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)