From cab594034833f8acf580c30ecfff57e44877a19b Mon Sep 17 00:00:00 2001 From: Jeevan Shriram Date: Fri, 24 Apr 2020 11:44:33 -0700 Subject: [PATCH 1/2] include: linux: remove unused APIs when CORESIGHT is disabled Remove unused apis when the config CORESIGHT is disabled to avoid compilation error. Change-Id: I1a05d26d8f07fc70c3f061c5d5debe1f4fb7edaa Signed-off-by: Jeevan Shriram --- include/linux/coresight.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/coresight.h b/include/linux/coresight.h index 60e1a6b38a79..be5cfe4c50c3 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -343,8 +343,6 @@ static inline int coresight_enable_reg_clk(struct coresight_device *csdev) { return -EINVAL; } -static void coresight_disable_all_source_link(void) {}; -static void coresight_enable_all_source_link(void) {}; #endif extern int coresight_get_cpu(struct device *dev); From 4f9c80079f2db5eb364688775892cd5bada1fbdc Mon Sep 17 00:00:00 2001 From: Jeevan Shriram Date: Tue, 2 Jun 2020 10:12:49 -0700 Subject: [PATCH 2/2] arm: mm: Fix compilation error when IOMMU is disabled Fix compilation when DMA uses IOMMU with the config flag CONFIG_ARM_DMA_USE_IOMMU. Change-Id: I6f20dbca6f3090a7d0d5d720800a12feed5d0dc2 Signed-off-by: Jeevan Shriram --- arch/arm/mm/dma-mapping.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 641034764a0c..75b5b4ee22e8 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -122,19 +122,6 @@ static pgprot_t __get_dma_pgprot(unsigned long attrs, pgprot_t prot, return prot; } -static bool is_dma_coherent(struct device *dev, unsigned long attrs, - bool is_coherent) -{ - if (attrs & DMA_ATTR_FORCE_COHERENT) - is_coherent = true; - else if (attrs & DMA_ATTR_FORCE_NON_COHERENT) - is_coherent = false; - else if (dev->archdata.dma_coherent) - is_coherent = true; - - return is_coherent; -} - /** * arm_dma_map_page - map a portion of a page for streaming DMA * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices @@ -1146,6 +1133,19 @@ static const struct dma_map_ops *arm_get_dma_map_ops(bool coherent) #ifdef CONFIG_ARM_DMA_USE_IOMMU +static bool is_dma_coherent(struct device *dev, unsigned long attrs, + bool is_coherent) +{ + if (attrs & DMA_ATTR_FORCE_COHERENT) + is_coherent = true; + else if (attrs & DMA_ATTR_FORCE_NON_COHERENT) + is_coherent = false; + else if (dev->archdata.dma_coherent) + is_coherent = true; + + return is_coherent; +} + static int __dma_info_to_prot(enum dma_data_direction dir, unsigned long attrs) { int prot = 0;