Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp3609367ybh; Mon, 5 Aug 2019 22:14:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUACYyQFGN63czsfHLQFoB0sduVputVSXl1jPq657GZc+BGk95Nv7J6656NaWEWS8uTw+q X-Received: by 2002:a63:e148:: with SMTP id h8mr1341646pgk.275.1565068482547; Mon, 05 Aug 2019 22:14:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565068482; cv=none; d=google.com; s=arc-20160816; b=d0/z8mNWKWGuusrXg1fvT3oQzUxFu2M3mCecxX42pNaaTnET2cP57Pwbx5mO1z9WGC xU6ypj1FrBf8J5FMi+d9Ehi6+8gxYwOfuif6/4WSH69QnF3Ung/VaY9B7PpstNZ0rZXR MBic6lG5YHAjsXpJVhda2MxSFLS3o88fq0Kkyoab4C4f1cwWILy1z57gpnvj+gvTw7TJ DHFqXzt4bxiYmoI+1utePt88xcusYYwk+AVq8fEnHUeH96tREFQypYOBeY7omZvkc3Hm 1ZcGJKZxygkC5mr4vmUiE4EIy0luc96VzGW+wnhgRC53ezYi82B4ulq4fLwcqg/zy2Mc gECw== 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=G4I4mrLSJI5moS+Zgtdd6/mYStSHLmpJRnLgiVyvreI=; b=FdQJos3higz7yvUElcYLARI+j1UHfQYLQ7DYUtmj4i3GKFwkhqh0p55Fx+Olx7yOKT JvjEkggtqbIlAgWTvQX25nuNPJ9VTSPW1ZGeGJkTPSA3AES1lYgaFtFEo2uK7pvWTIbM odrWHmRgIHT88jQ4BegMlqBZNJ/8PgWmD5WLZpxgW49eL5iQ9frn5Hf6/b2nhwFvR6X2 P9Yl9ja3SEifYNeu4mTAQL5fb3HMzp3MPpekl/jwf9udGv9RI9oIiJ95nWh0BZ3ZEAlW PAl3AVcE+lKaFTcrLQcqSDQocX4FvO8V2LZprh0OBN/r1rGIzUCN8KCBbtJsjmKkJgw6 56Tg== 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 w10si48331492pfq.115.2019.08.05.22.14.27; Mon, 05 Aug 2019 22:14:42 -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 S1731540AbfHFFMq (ORCPT + 99 others); Tue, 6 Aug 2019 01:12:46 -0400 Received: from verein.lst.de ([213.95.11.211]:53003 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726036AbfHFFMq (ORCPT ); Tue, 6 Aug 2019 01:12:46 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 8410D68B05; Tue, 6 Aug 2019 07:12:42 +0200 (CEST) Date: Tue, 6 Aug 2019 07:12:42 +0200 From: Christoph Hellwig To: Gavin Li Cc: Christoph Hellwig , Shawn Anastasio , Michael Ellerman , Russell King , Catalin Marinas , Will Deacon , Robin Murphy , Paul Burton , James Hogan , linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Gavin Li Subject: Re: [PATCH 1/2] dma-mapping: fix page attributes for dma_mmap_* Message-ID: <20190806051242.GA13269@lst.de> References: <20190805080145.5694-1-hch@lst.de> <20190805080145.5694-2-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Mon, Aug 05, 2019 at 07:55:44PM -0700, Gavin Li wrote: > > /* create a coherent mapping */ > > ret = dma_common_contiguous_remap(page, size, VM_USERMAP, > > - arch_dma_mmap_pgprot(dev, PAGE_KERNEL, attrs), > > + dma_pgprot(dev, PAGE_KERNEL, attrs), > > __builtin_return_address(0)); > > if (!ret) { > > __dma_direct_free_pages(dev, size, page); > > Is dma_common_contiguous_remap() still necessary in the > DMA_ATTR_NON_CONSISTENT case? I would presume it would be fine to just > return a linearly mapped address in that case. It would not be required for a real DMA_ATTR_NON_CONSISTENT implementation. But only parisc and mips actually properly implement DMA_ATTR_NON_CONSISTENT, everyone ignores it. Given that the API is a little ill defined and I have a better replacement in the pipeline I don't want to start implementing it for other architectures now.