2015-07-15 15:00:19

by Haggai Eran

[permalink] [raw]
Subject: [PATCH] dma-debug: skip debug_dma_assert_idle() when disabled

If dma-debug is disabled due to a memory error, DMA unmaps do not affect
the dma_active_cacheline radix tree anymore, and debug_dma_assert_idle()
can print false warnings.

Disable debug_dma_assert_idle() when dma_debug_disabled() is true.

Fixes: 0abdd7a81b7e ("dma-debug: introduce debug_dma_assert_idle()")
Cc: Dan Williams <[email protected]>
Cc: Joerg Roedel <[email protected]>
Cc: Vinod Koul <[email protected]>
Cc: Russell King <[email protected]>
Cc: James Bottomley <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Sebastian Ott <[email protected]>
Cc: Jiri Kosina <[email protected]>
Cc: Horia Geanta <[email protected]>
Signed-off-by: Haggai Eran <[email protected]>
---
lib/dma-debug.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index ae4b65e17e64..dace71fe41f7 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -574,6 +574,9 @@ void debug_dma_assert_idle(struct page *page)
unsigned long flags;
phys_addr_t cln;

+ if (dma_debug_disabled())
+ return;
+
if (!page)
return;

--
1.7.11.2