Skip to content

Commit 2481366

Browse files
ndreystorvalds
authored andcommitted
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]>
1 parent 5b398e4 commit 2481366

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/dma-mapping.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ static inline int dma_mmap_wc(struct device *dev,
718718
#define dma_mmap_writecombine dma_mmap_wc
719719
#endif
720720

721-
#ifdef CONFIG_NEED_DMA_MAP_STATE
721+
#if defined(CONFIG_NEED_DMA_MAP_STATE) || defined(CONFIG_DMA_API_DEBUG)
722722
#define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME
723723
#define DEFINE_DMA_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME
724724
#define dma_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME)

0 commit comments

Comments
 (0)