Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp4262340ybh; Tue, 6 Aug 2019 08:47:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGemfPv3n2Ko83pKj//XKokXZr2HeVJh+uKOIwwcPgfv9h+RYhZDeY9LUG6gaTCjj1ASb8 X-Received: by 2002:a17:90a:23a4:: with SMTP id g33mr3980658pje.115.1565106463466; Tue, 06 Aug 2019 08:47:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565106463; cv=none; d=google.com; s=arc-20160816; b=hGrXmI3uICzwBmRKLdP+Io08JmYzXagcEtIB6fyBEyPkyT2muxwEvePeKluTaQ3Aeg bgKwT3/jWTY1IM55Fnr7GhgtphzKuSIv7rVt8dDXCb2GT05IL51x46v7qQSg0q0/gDQP J2L741hArK2q5/vHQ50Cc0ESzkiZuM+wYRFyeizuUbIccsWnj+TfEn0y/FHqaFe+W5aV L/8m14zmWa36driLhCkpUdY4e0tCfg+5zeHDMdIBadlky9yQQumXz5ikgWjuQNbfSFjH WF3iVpT5yUDTdP1qwqP9vCZNQ71We+3AgMlTm+88BmmAl9SYWFq35AL5A/ozslJSRjmo cVZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Rdworwec2B2QqPdd/ugu58Ssk7hG57tZcGILPB6eD8M=; b=NvwGYpc4KTcYE8owGlfzNgzfjM944JBJpoeDvvDt+vYpopcsHRc3JOrUUc3nKPEHwG GuDv7Br8mMUsAAedHacHeHQgNjLOdum8Pmjj/OKLLMuCLcneulwmf5GNNpPpFq2DxbJ+ d7fEHHyAJIFRExe1leJOaJL6xWzpzrjwSz/kkOL0ySkOKT6S7tmeEaM1UhcIdYZnwhQJ VzK/Ugci0K5jdwL44YLIVJeDp0FMII/tlVI8wU/zWRbRTv7NXv0HJJS7Os7nabdFNm9Y KKazsBB2Ts7d1fSVxo1ftg9/MH272HfQ6Ny3XAyr764kToO1SjbFGQZ8YjhIMmAaqoxd RCOg== 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 z3si14848592pju.48.2019.08.06.08.47.27; Tue, 06 Aug 2019 08:47:43 -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 S1732652AbfHFPqG (ORCPT + 99 others); Tue, 6 Aug 2019 11:46:06 -0400 Received: from verein.lst.de ([213.95.11.211]:57452 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726373AbfHFPqG (ORCPT ); Tue, 6 Aug 2019 11:46:06 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 96D88227A81; Tue, 6 Aug 2019 17:46:02 +0200 (CEST) Date: Tue, 6 Aug 2019 17:46:02 +0200 From: Christoph Hellwig To: "Lendacky, Thomas" Cc: Lucas Stach , Christoph Hellwig , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , Thiago Jung Bauermann , Halil Pasic Subject: Re: Regression due to d98849aff879 (dma-direct: handle DMA_ATTR_NO_KERNEL_MAPPING in common code) Message-ID: <20190806154602.GB25050@lst.de> References: <1565082809.2323.24.camel@pengutronix.de> <20190806113318.GA20215@lst.de> <41cc93b1-62b5-7fb6-060d-01982e68503b@amd.com> <20190806140408.GA22902@lst.de> <1565100418.2323.32.camel@pengutronix.de> <78833204-cd30-1a4b-54e3-1580018c6d57@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <78833204-cd30-1a4b-54e3-1580018c6d57@amd.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 06, 2019 at 02:18:49PM +0000, Lendacky, Thomas wrote: > I think you need to keep everything inside the original if statement since > the caller is expecting a page pointer to be returned in this case and not > the page_address() which is returned when the DMA_ATTR_NO_KERNEL_MAPPING > is not present. DMA_ATTR_NO_KERNEL_MAPPING is defined to return an opaque cookie, which just happens to be a page pointer. So if we fix up the free side as pointed out by Lucas we should be fine.