Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp495243yba; Fri, 5 Apr 2019 10:42:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxxil039H0piPE9fovTi32H50HKPdYr+PlGUpkC0y0ZLmNFzM8PnoS/5kfvpagOyL6947tM X-Received: by 2002:a65:6659:: with SMTP id z25mr12868307pgv.10.1554486129520; Fri, 05 Apr 2019 10:42:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554486129; cv=none; d=google.com; s=arc-20160816; b=Yz1X32esbGxOPx/3A9UcNutHiCO1JwOSS1O91XQiW2ctqGMwqnwNnhAtUhbH/ZMCDF EHiuhStZ++a3kKHuu9Xl5+g52fvLWPheZSFhEgFI06p0Aaj/Ouh1FSfKwxxwlAuwtweq H/gvI1pDMe7qmXfH4J4m/2mx2eycHYPwn879EZubqEhol7UF7xWBa2WP0L2URlxUUxCv QE38JzyxG9WUAPFB/9tttftU3mAtgnKQvCxM2BDoBR0eZ8+1SoA+Dr737BDIzgGsLtUt lMSbvsksft6Vs2eWvXXQUf5MK0V7bLTNDJFFUh4qwHd1mTQIpk2nasn6jiVJgsSqfYv3 IHHQ== 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:user-agent:date :message-id:from:references:cc:to:subject; bh=rrGlNcocOjjSes0wTH8yxivonuygKMeoZh/d/2NfSJw=; b=c1fy/jBnj4lWCTTpyuPJNJxmSDs0eJvtkz/jxYlgNlBH3cIwEBPPDQcvxuq4cmLlPP mG32aGImv1FYatclBv8eYX6ZklvG49Y9xKkNOiSGrJtNEH1oA/xQZZdfB756f5wFKd/O QCPfZ41t7rbeGYqZpdYsRPcsYs+hhHr60AcZD2yo9qTwIKcKgT616vzX1pxTMn2Ozjb7 MPtcGoDwY0CukyyqECT6GMTulxAMWT8kNVGwE29DrLCt40bo3UR3GxEVA7TvcGlQNc3U 5TGIoxBt+WsJ5v1pQlQdc0rYp7h6zWR7DyC1opNpBVRFa/bDL0onUU03tLTNy+LtrLI5 VQ3w== 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 p15si20098327pli.414.2019.04.05.10.41.54; Fri, 05 Apr 2019 10:42:09 -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 S1731591AbfDERlG (ORCPT + 99 others); Fri, 5 Apr 2019 13:41:06 -0400 Received: from foss.arm.com ([217.140.101.70]:53682 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730329AbfDERlF (ORCPT ); Fri, 5 Apr 2019 13:41:05 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EA7CF168F; Fri, 5 Apr 2019 10:41:04 -0700 (PDT) Received: from [10.1.196.75] (e110467-lin.cambridge.arm.com [10.1.196.75]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 920933F557; Fri, 5 Apr 2019 10:41:03 -0700 (PDT) Subject: Re: [PATCH 03/21] dma-mapping: add a Kconfig symbol to indicated arch_dma_prep_coherent presence To: Christoph Hellwig Cc: Joerg Roedel , Catalin Marinas , Will Deacon , Tom Lendacky , iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20190327080448.5500-1-hch@lst.de> <20190327080448.5500-4-hch@lst.de> From: Robin Murphy Message-ID: <7c464875-b23a-9da4-afe7-93d7879ca3b8@arm.com> Date: Fri, 5 Apr 2019 18:41:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190327080448.5500-4-hch@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/03/2019 08:04, Christoph Hellwig wrote: > Add a Kconfig symbol that indicates an architecture provides a > arch_dma_prep_coherent implementation, and provide a stub otherwise. > > This will allow the generic dma-iommu code to it while still allowing I think you accidentally a word there. > to be built for cache coherent architectures. > > Signed-off-by: Christoph Hellwig > --- > arch/arm64/Kconfig | 1 + > arch/csky/Kconfig | 1 + > include/linux/dma-noncoherent.h | 6 ++++++ > kernel/dma/Kconfig | 3 +++ > 4 files changed, 11 insertions(+) > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index 7e34b9eba5de..adda078d6df7 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -13,6 +13,7 @@ config ARM64 > select ARCH_HAS_DEVMEM_IS_ALLOWED > select ARCH_HAS_DMA_COHERENT_TO_PFN > select ARCH_HAS_DMA_MMAP_PGPROT > + select ARCH_HAS_DMA_PREP_COHERENT > select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI > select ARCH_HAS_ELF_RANDOMIZE > select ARCH_HAS_FAST_MULTIPLIER > diff --git a/arch/csky/Kconfig b/arch/csky/Kconfig > index 725a115759c9..2c3178848b7d 100644 > --- a/arch/csky/Kconfig > +++ b/arch/csky/Kconfig > @@ -1,6 +1,7 @@ > config CSKY > def_bool y > select ARCH_32BIT_OFF_T > + select ARCH_HAS_DMA_PREP_COHERENT > select ARCH_HAS_SYNC_DMA_FOR_CPU > select ARCH_HAS_SYNC_DMA_FOR_DEVICE > select ARCH_USE_BUILTIN_BSWAP > diff --git a/include/linux/dma-noncoherent.h b/include/linux/dma-noncoherent.h > index 69b36ed31a99..9741767e400f 100644 > --- a/include/linux/dma-noncoherent.h > +++ b/include/linux/dma-noncoherent.h > @@ -72,6 +72,12 @@ static inline void arch_sync_dma_for_cpu_all(struct device *dev) > } > #endif /* CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL */ > > +#ifdef CONFIG_ARCH_HAS_DMA_PREP_COHERENT > void arch_dma_prep_coherent(struct page *page, size_t size); > +#else > +static inline void arch_dma_prep_coherent(struct page *page, size_t size) > +{ > +} > +#endif /* CONFIG_ARCH_HAS_DMA_PREP_COHERENT */ > > #endif /* _LINUX_DMA_NONCOHERENT_H */ > diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig > index a06ba3013b3b..feff2d21d8ee 100644 > --- a/kernel/dma/Kconfig > +++ b/kernel/dma/Kconfig > @@ -38,6 +38,9 @@ config ARCH_HAS_SYNC_DMA_FOR_CPU > config ARCH_HAS_SYNC_DMA_FOR_CPU_ALL > bool > > +config ARCH_HAS_DMA_PREP_COHERENT > + bool > + I guess the sorting in this whole Kconfig is already more or less "randomly-perturbed semi-alphabetical" :( Anyway, Reviewed-by: Robin Murphy > config ARCH_HAS_DMA_COHERENT_TO_PFN > bool > >