Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751702AbdFZJpp (ORCPT ); Mon, 26 Jun 2017 05:45:45 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:35284 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751397AbdFZJph (ORCPT ); Mon, 26 Jun 2017 05:45:37 -0400 Date: Mon, 26 Jun 2017 02:45:35 -0700 From: Christoph Hellwig To: Vladimir Murzin Cc: Christoph Hellwig , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux@armlinux.org.uk, sza@esh.hu, arnd@arndb.de, gregkh@linuxfoundation.org, akpm@linux-foundation.org, alexandre.torgue@st.com, robin.murphy@arm.com, benjamin.gaignard@linaro.org, kbuild-all@01.org, Joerg Roedel , Christian Borntraeger Subject: Re: [PATCH v5 2/7] dma: Add simple dma_noop_mmap Message-ID: <20170626094535.GD21570@infradead.org> References: <1495621472-9323-1-git-send-email-vladimir.murzin@arm.com> <1495621472-9323-3-git-send-email-vladimir.murzin@arm.com> <20170620132324.GA11370@infradead.org> <8670225a-30a5-d567-0979-c96fd115a50f@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8670225a-30a5-d567-0979-c96fd115a50f@arm.com> User-Agent: Mutt/1.8.0 (2017-02-23) 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1036 Lines: 20 On Thu, Jun 22, 2017 at 01:46:09PM +0100, Vladimir Murzin wrote: > On 20/06/17 14:23, Christoph Hellwig wrote: > > On Wed, May 24, 2017 at 11:24:27AM +0100, Vladimir Murzin wrote: > >> This patch adds a simple implementation of mmap to dma_noop_ops. > > > > Currently we use dma_common_mmap as the generic fallback if a dma_ops > > instance doesn't implement a mmap method. Can you just fix up > > dma_common_mmap for your nommu case - it looks like yours is basically > > a subset. > > dma_common_map() is guarded with CONFIG_MMU and I'm not dare to change that > since I have no idea 1) why it was done 2) how it affects other arches :( That's still not a good reason for duplicating it. Please instead make all the existing nommu architecture select CONFIG_ARCH_NO_COHERENT_DMA_MMAP as a prep patch, then provide an arch helper to abstract away the pgprot_noncached, then lift CONFIG_ARCH_NO_COHERENT_DMA_MMAP for arm nommu. Bonus points for lifting it elsewhere or consolidating various copy & paste versions of the function.