aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Smirnov <[email protected]>2016-09-28 15:22:33 -0700
committerLinus Torvalds <[email protected]>2016-09-28 16:19:01 -0700
commit2481366afd71a0c0b7cd725e6750c04cf589673b (patch)
treebddefbe87e77de1c6d7d5d6e77ea85155973b45e
parent5b398e416e880159fe55eefd93c6588fa072cd66 (diff)
dma-mapping.h: preserve unmap info for CONFIG_DMA_API_DEBUG
When CONFIG_DMA_API_DEBUG is enabled we need to preserve unmapping address even if "unmap" is a no-op for our architecutre because we need debug_dma_unmap_page() to correctly cleanup all of the debug bookkeeping. Failing to do so results in a false positive warnings about previously mapped areas never being unmapped. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Andrey Smirnov <[email protected]> Reviewed-by: Robin Murphy <[email protected]> Cc: Joerg Roedel <[email protected]> Cc: Will Deacon <[email protected]> Cc: Zhen Lei <[email protected]> Cc: "Luis R. Rodriguez" <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Geliang Tang <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--include/linux/dma-mapping.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 66533e18276c..dc69df04abc1 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -718,7 +718,7 @@ static inline int dma_mmap_wc(struct device *dev,
#define dma_mmap_writecombine dma_mmap_wc
#endif
-#ifdef CONFIG_NEED_DMA_MAP_STATE
+#if defined(CONFIG_NEED_DMA_MAP_STATE) || defined(CONFIG_DMA_API_DEBUG)
#define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME
#define DEFINE_DMA_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME
#define dma_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME)