Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp4499430ybh; Tue, 6 Aug 2019 12:48:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/lBM/I1Uz3VkPM0Clu8zmFF7KetvQhDFUKxD+ZJHz7S6PUI+p7bmHRgd9FEMgtV8BCx+A X-Received: by 2002:a65:690f:: with SMTP id s15mr4361836pgq.432.1565120928314; Tue, 06 Aug 2019 12:48:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565120928; cv=none; d=google.com; s=arc-20160816; b=wReubJ2Mhn7oc8eoul1aAfT+DgG/PpjS6rT8SFeLaFVf4I5x700CzsE+S5dqiHK7TJ CgkO8ap4u+zWmJk6Lb+SwRr2BK5U5pJdorvLg4cw2Yz0Dl390gDeFChKc6UkPRVhfbrV nZ4ajffoBpwtcqFIAvpJJWO0/O3mR2UQd2+5XNrfdimJj4/guhbgM/chrtb/UTQEh2id ykOmBzwSjrNaZrdFQd7rEVWBwcR26Cyy8hc1vcQTfS1RygF2XqG0gchBffaWgzqFyzUG j3/dbVA5NrdVwemcItX4LugXXgG3IK7Xu64KdflePvocJADSUHfnT6qp27Xi4XW0p0r3 w1Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:date:message-id:from :references:cc:to:subject:dkim-signature; bh=4h5CgyRmpHxpaPm6whXxmIt+l681rMFZn6eQJaCU0mY=; b=A9zHp8pMHVznjoRyRGyhEVkAZt68csilopJCrJxs+umll5rfgf+8JqQ+pCso22LO2X 9m1iu4TKEyONPq5U6CFHy23N0oOVm9AilX2PXRl8nareVkot/6+TubuI3pMsn6jjmbFG fedtnEIdD+3fJ7Y+jJ689SzwjYUoPZNZR9lLB5bx8S6CsMiVeLto/2nrSH4KNPm8G8/n b5C0nG9rYrMeH4JElvbmRfK4xE0UZ/HFUmDnRNrgXq/3V95rwhX1SAxrDnz0EwOvwhtW I3IXNoTy5I0StsKpjd+HycZFMRPibX9a5YCo+P4Qelus0PfPHHCr9G8AOsUzKGvozoyv GbsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@anastas.io header.s=mail header.b="VF/YxkoG"; 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=anastas.io Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y4si7303845plk.123.2019.08.06.12.48.32; Tue, 06 Aug 2019 12:48:48 -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=@anastas.io header.s=mail header.b="VF/YxkoG"; 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=anastas.io Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726301AbfHFTrT (ORCPT + 99 others); Tue, 6 Aug 2019 15:47:19 -0400 Received: from alpha.anastas.io ([104.248.188.109]:34451 "EHLO alpha.anastas.io" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725798AbfHFTrT (ORCPT ); Tue, 6 Aug 2019 15:47:19 -0400 X-Greylist: delayed 486 seconds by postgrey-1.27 at vger.kernel.org; Tue, 06 Aug 2019 15:47:19 EDT Received: from authenticated-user (alpha.anastas.io [104.248.188.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alpha.anastas.io (Postfix) with ESMTPSA id 2FB9F7F91A; Tue, 6 Aug 2019 14:39:08 -0500 (CDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=anastas.io; s=mail; t=1565120352; bh=HXAHKgiQsfJr2nTxca5W5Al0GVPsqRNPo3FiFtTBIoc=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=VF/YxkoGj8ca1JQcWi5sYSQVWRKBYyZtR9HUzDE+ew2GrVyUCIeEXZFt6rVd6W6wg vtSTCcBTAjJH0ZszPuJKYt0eFgEDwICoBRPS0wGBydBz0++9N23+H7Ed3B5qGV1VMC LvZrV59lni9MLs/JcvnzGbRKNJzNv+d8Qk4W2RBQao6w281+TddI5F/TzpRT8SkiIO nhUyXU745H9K0uufXJpjZAa7VpAkGr/JSB0EdEr/q/xdFRPa19oitpAqc+ktLxg9Is kcvPFe0HGSSTtWUCJqLE5dUJRbo5Vz5U2m6kzrfDAVngIfOzeFSuQSEh/otww7M/bt SjEGu4AGs8jvg== Subject: Re: [PATCH 1/2] dma-mapping: fix page attributes for dma_mmap_* To: Christoph Hellwig , iommu@lists.linux-foundation.org Cc: 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 References: <20190805080145.5694-1-hch@lst.de> <20190805080145.5694-2-hch@lst.de> From: Shawn Anastasio Message-ID: <7df95ffb-6df3-b118-284c-ee32cad81199@anastas.io> Date: Tue, 6 Aug 2019 21:39:06 +0200 MIME-Version: 1.0 In-Reply-To: <20190805080145.5694-2-hch@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/5/19 10:01 AM, Christoph Hellwig wrote: > diff --git a/include/linux/dma-noncoherent.h b/include/linux/dma-noncoherent.h > index 3813211a9aad..9ae5cee543c4 100644 > --- a/include/linux/dma-noncoherent.h > +++ b/include/linux/dma-noncoherent.h > @@ -42,13 +42,8 @@ void arch_dma_free(struct device *dev, size_t size, void *cpu_addr, > dma_addr_t dma_addr, unsigned long attrs); > long arch_dma_coherent_to_pfn(struct device *dev, void *cpu_addr, > dma_addr_t dma_addr); > - > -#ifdef CONFIG_ARCH_HAS_DMA_MMAP_PGPROT > pgprot_t arch_dma_mmap_pgprot(struct device *dev, pgprot_t prot, > unsigned long attrs); > -#else > -# define arch_dma_mmap_pgprot(dev, prot, attrs) pgprot_noncached(prot) > -#endif Nit, but maybe the prototype should still be ifdef'd here? It at least could prevent a reader from incorrectly thinking that the function is always present. Also, like Will mentioned earlier, the function name isn't entirely accurate anymore. I second the suggestion of using something like arch_dma_noncoherent_pgprot(). As for your idea of defining pgprot_dmacoherent for all architectures as #ifndef pgprot_dmacoherent #define pgprot_dmacoherent pgprot_noncached #endif I think that the name here is kind of misleading too, since this definition will only be used when there is no support for proper DMA coherency.