Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp3518804ima; Mon, 4 Feb 2019 00:17:05 -0800 (PST) X-Google-Smtp-Source: ALg8bN4iCsprv06b9AauSOoVaPtVWDr/u+ODUTKQjlMZUhXAv8VUigvsqorJWQhF6H0Ndwn6Anik X-Received: by 2002:a63:fa06:: with SMTP id y6mr45618573pgh.177.1549268224940; Mon, 04 Feb 2019 00:17:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549268224; cv=none; d=google.com; s=arc-20160816; b=d1AiT8z/5VuW7XKriVB8PS48QuZBZAniAm+ywvt72zOmV4xuTaSw7trMK2hE+AU5zl qHP+Bw9LoNgsnG3OBRw2TpQJeragpUtcm3BqeCx03KLiKz+7Imz9cGjJ+GWelAu5kfnz w41kt2aoTmhvEYbH+/sv+7tR7RjyUM9KciPkyUNj8yXWgKl7qSsSOUf5s9/CFy4rp8/+ VCxb0wyC0bRpsbjO5vKh2HThwXnlM2Y79K0ZxKXDD5RDgyfchkPASDmO1tZhoPaM6s1G iSB7//sh4AIfokYN/pWwjSUQflPqTnajlbF3L5jS1T9kVbiRNUOrzmNVErTIEHUcC5pb S8qQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pj/gGyzWDbQ1LrtzEjX8pE/7qwnWQICqgRh5Uy8QyL0=; b=V+83DVBB4Com/w0jP55zc3TtMMS+0ImDtb15JWXlD1KbO5TlZpqMBkk1mB9/DDkpdd kXOeMZGhLaW/+kSdY3ZI3RbpoVxpWMKTnN0a4HK/Yv8NHpnILFDmY1a7z3E18QI8/GDr YtUYIywTPzxYXE4qMxnGiyPD5axzA/v6P5xblRno4XlrVNh3ocNDcgwbLNlQWZ0nerkU u7d67pVlyX9lqyl3kSpxdE1ZJLX20ibBQn5hIkNnlFO1S2PIG+dgdNSXr1H+7IdLFb12 dAuIrPWbZwlMcVDXrq/QepywvvHzm4cz1zES7w+nTggE9lkUy3ajPb/1j97CA7m65XF4 s4NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=iqC87PC6; 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 t4si15131062pfj.183.2019.02.04.00.16.49; Mon, 04 Feb 2019 00:17:04 -0800 (PST) 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=@infradead.org header.s=bombadil.20170209 header.b=iqC87PC6; 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 S1728343AbfBDIOj (ORCPT + 99 others); Mon, 4 Feb 2019 03:14:39 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:51472 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726795AbfBDIOh (ORCPT ); Mon, 4 Feb 2019 03:14:37 -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=pj/gGyzWDbQ1LrtzEjX8pE/7qwnWQICqgRh5Uy8QyL0=; b=iqC87PC6yQA8LQWjSZ1o5HRzD0 iPh3Q4x+rL5/mwYpFdUTCJKqPrQrAsN2C9uOR2RTg0L3lno+RJR1ySaqjIYTtE6E7cCq34pIOzOcF QkJV6oPB4I1g9/ZsX0pGG6H9I+gWYtggNa4mOi9bL7RQHpmRRcGIZjUwGU370PEedzOoI3OggI8WF 3x9/o+eEyipOzzmroQ5ISd3ONiTA/+ctZzlEo8EkUV7sJdYPy85sGZlPUlykz0AQmKI6nVc7zEeUQ GiGJSDX7MtrAhM5lO+gzbPa8qPmzZ3UYcD9OsKsTsX8YBn8Y9J9LtzUHZxtsiE7Kt01J7f/4Gub+Q Fk3Z+adA==; Received: from 089144212163.atnat0021.highway.a1.net ([89.144.212.163] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gqZOf-0008R5-GZ; Mon, 04 Feb 2019 08:14:29 +0000 From: Christoph Hellwig To: Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Paul Burton Cc: linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] dma-mapping: add a kconfig symbol for arch_teardown_dma_ops availability Date: Mon, 4 Feb 2019 09:14:20 +0100 Message-Id: <20190204081420.15083-3-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190204081420.15083-1-hch@lst.de> References: <20190204081420.15083-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 Signed-off-by: Christoph Hellwig --- arch/arm/Kconfig | 1 + arch/arm/include/asm/dma-mapping.h | 5 ----- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/dma-mapping.h | 5 ----- include/linux/dma-mapping.h | 10 +++++++--- kernel/dma/Kconfig | 3 +++ 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index c1cf44f00870..4bb36ae71b14 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -16,6 +16,7 @@ config ARM select ARCH_HAS_SET_MEMORY select ARCH_HAS_STRICT_KERNEL_RWX if MMU && !XIP_KERNEL select ARCH_HAS_STRICT_MODULE_RWX if MMU + select ARCH_HAS_TEARDOWN_DMA_OPS if MMU select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST select ARCH_HAVE_CUSTOM_GPIO_H select ARCH_HAS_GCOV_PROFILE_ALL diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h index a224b6e39e58..03ba90ffc0f8 100644 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h @@ -96,11 +96,6 @@ static inline unsigned long dma_max_pfn(struct device *dev) } #define dma_max_pfn(dev) dma_max_pfn(dev) -#ifdef CONFIG_MMU -#define arch_teardown_dma_ops arch_teardown_dma_ops -extern void arch_teardown_dma_ops(struct device *dev); -#endif - /* do not use this function in a driver */ static inline bool is_device_dma_coherent(struct device *dev) { diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 63909f318d56..87ec7be25e97 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -29,6 +29,7 @@ config ARM64 select ARCH_HAS_SYNC_DMA_FOR_DEVICE select ARCH_HAS_SYNC_DMA_FOR_CPU select ARCH_HAS_SYSCALL_WRAPPER + select ARCH_HAS_TEARDOWN_DMA_OPS if IOMMU_SUPPORT select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST select ARCH_HAVE_NMI_SAFE_CMPXCHG select ARCH_INLINE_READ_LOCK if !PREEMPT diff --git a/arch/arm64/include/asm/dma-mapping.h b/arch/arm64/include/asm/dma-mapping.h index de96507ee2c1..de98191e4c7d 100644 --- a/arch/arm64/include/asm/dma-mapping.h +++ b/arch/arm64/include/asm/dma-mapping.h @@ -29,11 +29,6 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) return NULL; } -#ifdef CONFIG_IOMMU_DMA -void arch_teardown_dma_ops(struct device *dev); -#define arch_teardown_dma_ops arch_teardown_dma_ops -#endif - /* * Do not use this function in a driver, it is only provided for * arch/arm/mm/xen.c, which is used by arm64 as well. diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 2b20d60e6158..4210c5c1dd21 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -681,9 +681,13 @@ static inline void arch_setup_dma_ops(struct device *dev, u64 dma_base, } #endif /* CONFIG_ARCH_HAS_SETUP_DMA_OPS */ -#ifndef arch_teardown_dma_ops -static inline void arch_teardown_dma_ops(struct device *dev) { } -#endif +#ifdef CONFIG_ARCH_HAS_TEARDOWN_DMA_OPS +void arch_teardown_dma_ops(struct device *dev); +#else +static inline void arch_teardown_dma_ops(struct device *dev) +{ +} +#endif /* CONFIG_ARCH_HAS_TEARDOWN_DMA_OPS */ static inline unsigned int dma_get_max_seg_size(struct device *dev) { diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig index c44599d128e8..77a352259796 100644 --- a/kernel/dma/Kconfig +++ b/kernel/dma/Kconfig @@ -22,6 +22,9 @@ config HAVE_GENERIC_DMA_COHERENT config ARCH_HAS_SETUP_DMA_OPS bool +config ARCH_HAS_TEARDOWN_DMA_OPS + bool + config ARCH_HAS_SYNC_DMA_FOR_DEVICE bool -- 2.20.1