[PATCH] dma-mapping: Remove dma_mark_clean (again)

Robin Murphy posted 1 patch 1 month ago
include/linux/dma-map-ops.h | 8 --------
kernel/dma/Kconfig          | 6 ------
kernel/dma/direct.c         | 3 ---
kernel/dma/direct.h         | 3 ---
4 files changed, 20 deletions(-)
[PATCH] dma-mapping: Remove dma_mark_clean (again)
Posted by Robin Murphy 1 month ago
With IA-64 now gone, there are no users of the dma_mark_clean hook,
so we can retire it for good.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
---
 include/linux/dma-map-ops.h | 8 --------
 kernel/dma/Kconfig          | 6 ------
 kernel/dma/direct.c         | 3 ---
 kernel/dma/direct.h         | 3 ---
 4 files changed, 20 deletions(-)

diff --git a/include/linux/dma-map-ops.h b/include/linux/dma-map-ops.h
index 4809204c674c..64349e1b6535 100644
--- a/include/linux/dma-map-ops.h
+++ b/include/linux/dma-map-ops.h
@@ -377,14 +377,6 @@ static inline void arch_dma_prep_coherent(struct page *page, size_t size)
 }
 #endif /* CONFIG_ARCH_HAS_DMA_PREP_COHERENT */
 
-#ifdef CONFIG_ARCH_HAS_DMA_MARK_CLEAN
-void arch_dma_mark_clean(phys_addr_t paddr, size_t size);
-#else
-static inline void arch_dma_mark_clean(phys_addr_t paddr, size_t size)
-{
-}
-#endif /* ARCH_HAS_DMA_MARK_CLEAN */
-
 void *arch_dma_set_uncached(void *addr, size_t size);
 void arch_dma_clear_uncached(void *addr, size_t size);
 
diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig
index 31cfdb6b4bc3..159900736f25 100644
--- a/kernel/dma/Kconfig
+++ b/kernel/dma/Kconfig
@@ -47,12 +47,6 @@ config ARCH_HAS_DMA_SET_MASK
 config ARCH_HAS_DMA_WRITE_COMBINE
 	bool
 
-#
-# Select if the architectures provides the arch_dma_mark_clean hook
-#
-config ARCH_HAS_DMA_MARK_CLEAN
-	bool
-
 config DMA_DECLARE_COHERENT
 	bool
 
diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
index 50c3fe2a1d55..c9fa983990cd 100644
--- a/kernel/dma/direct.c
+++ b/kernel/dma/direct.c
@@ -425,9 +425,6 @@ void dma_direct_sync_sg_for_cpu(struct device *dev,
 			arch_sync_dma_for_cpu(paddr, sg->length, dir);
 
 		swiotlb_sync_single_for_cpu(dev, paddr, sg->length, dir);
-
-		if (dir == DMA_FROM_DEVICE)
-			arch_dma_mark_clean(paddr, sg->length);
 	}
 
 	if (!dev_is_dma_coherent(dev))
diff --git a/kernel/dma/direct.h b/kernel/dma/direct.h
index da2fadf45bcd..f476c63b668c 100644
--- a/kernel/dma/direct.h
+++ b/kernel/dma/direct.h
@@ -75,9 +75,6 @@ static inline void dma_direct_sync_single_for_cpu(struct device *dev,
 	}
 
 	swiotlb_sync_single_for_cpu(dev, paddr, size, dir);
-
-	if (dir == DMA_FROM_DEVICE)
-		arch_dma_mark_clean(paddr, size);
 }
 
 static inline dma_addr_t dma_direct_map_phys(struct device *dev,
-- 
2.34.1
Re: [PATCH] dma-mapping: Remove dma_mark_clean (again)
Posted by Marek Szyprowski 1 month ago
On 06.01.2026 20:27, Robin Murphy wrote:
> With IA-64 now gone, there are no users of the dma_mark_clean hook,
> so we can retire it for good.
>
> Signed-off-by: Robin Murphy <robin.murphy@arm.com>


Applied to dma-mapping-for-next. Thanks!


Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland