From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCA7EC282C2 for ; Wed, 13 Feb 2019 18:31:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B348B2086C for ; Wed, 13 Feb 2019 18:31:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="A2x2MCsu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391015AbfBMS3j (ORCPT ); Wed, 13 Feb 2019 13:29:39 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:54666 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393739AbfBMS3g (ORCPT ); Wed, 13 Feb 2019 13:29:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=drHMZ751noz647lRXLCA7AAVY+t0b0zq+MxRQnJyJPk=; b=A2x2MCsu30gDySTU/HwYo1Jqyt B4w89vUqTsXn7WLVg0A5QbCFn/emjM5UEtAXkk8am85u+/BaFsDvPzioAcwBNTs3PSWMV2jBAfYXY CV0TNak3uJPS1FKWx//f8/XNQxs1ooXWT5zULsYtgISPszhByFiJhHgPQa4PiPpuVHGlPhBUkpEDd aluXwvvJa5burdItDZjhyC6NIvAJWZhbZ1VA+sa3Nndv0dHysoW+VaGYJLxft6nTmQjYnbAl9tV7j R21PXNr9qBT1KxYldFW6IuAQN/XQ78bRw98rDAh8W94J/esa958iZeAGqmcgGFIawCIn+1Qt73QY0 Qci74gUQ==; Received: from 089144210182.atnat0019.highway.a1.net ([89.144.210.182] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gtzHl-0007of-5Y; Wed, 13 Feb 2019 18:29:29 +0000 From: Christoph Hellwig To: Robin Murphy 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 Subject: [PATCH 03/21] dma-mapping: add a Kconfig symbol to indicated arch_dma_prep_coherent presence Date: Wed, 13 Feb 2019 19:29:02 +0100 Message-Id: <20190213182920.16764-4-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190213182920.16764-1-hch@lst.de> References: <20190213182920.16764-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 87ec7be25e97..52175007ffb7 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 398113c845f5..8b84d4362ff6 100644 --- a/arch/csky/Kconfig +++ b/arch/csky/Kconfig @@ -1,5 +1,6 @@ config CSKY def_bool y + 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 bde9179c6ed7..c3b2a5ae2dd4 100644 --- a/kernel/dma/Kconfig +++ b/kernel/dma/Kconfig @@ -35,6 +35,9 @@ config ARCH_HAS_SYNC_DMA_FOR_CPU config ARCH_HAS_SYNC_DMA_FOR_CPU_ALL bool +config ARCH_HAS_DMA_PREP_COHERENT + bool + config ARCH_HAS_DMA_COHERENT_TO_PFN bool -- 2.20.1