diff options
-rw-r--r-- | include/linux/dma-debug.h | 20 | ||||
-rw-r--r-- | lib/dma-debug.c | 21 |
2 files changed, 41 insertions, 0 deletions
diff --git a/include/linux/dma-debug.h b/include/linux/dma-debug.h index cb72dfd87326..0eee7af5143f 100644 --- a/include/linux/dma-debug.h +++ b/include/linux/dma-debug.h | |||
@@ -49,6 +49,14 @@ extern void debug_dma_alloc_coherent(struct device *dev, size_t size, | |||
49 | extern void debug_dma_free_coherent(struct device *dev, size_t size, | 49 | extern void debug_dma_free_coherent(struct device *dev, size_t size, |
50 | void *virt, dma_addr_t addr); | 50 | void *virt, dma_addr_t addr); |
51 | 51 | ||
52 | extern void debug_dma_sync_single_for_cpu(struct device *dev, | ||
53 | dma_addr_t dma_handle, size_t size, | ||
54 | int direction); | ||
55 | |||
56 | extern void debug_dma_sync_single_for_device(struct device *dev, | ||
57 | dma_addr_t dma_handle, | ||
58 | size_t size, int direction); | ||
59 | |||
52 | #else /* CONFIG_DMA_API_DEBUG */ | 60 | #else /* CONFIG_DMA_API_DEBUG */ |
53 | 61 | ||
54 | static inline void dma_debug_init(u32 num_entries) | 62 | static inline void dma_debug_init(u32 num_entries) |
@@ -89,6 +97,18 @@ static inline void debug_dma_free_coherent(struct device *dev, size_t size, | |||
89 | { | 97 | { |
90 | } | 98 | } |
91 | 99 | ||
100 | static inline void debug_dma_sync_single_for_cpu(struct device *dev, | ||
101 | dma_addr_t dma_handle, | ||
102 | size_t size, int direction) | ||
103 | { | ||
104 | } | ||
105 | |||
106 | static inline void debug_dma_sync_single_for_device(struct device *dev, | ||
107 | dma_addr_t dma_handle, | ||
108 | size_t size, int direction) | ||
109 | { | ||
110 | } | ||
111 | |||
92 | #endif /* CONFIG_DMA_API_DEBUG */ | 112 | #endif /* CONFIG_DMA_API_DEBUG */ |
93 | 113 | ||
94 | #endif /* __DMA_DEBUG_H */ | 114 | #endif /* __DMA_DEBUG_H */ |
diff --git a/lib/dma-debug.c b/lib/dma-debug.c index 44af837f68ef..714cfb6ca0e4 100644 --- a/lib/dma-debug.c +++ b/lib/dma-debug.c | |||
@@ -737,3 +737,24 @@ void debug_dma_free_coherent(struct device *dev, size_t size, | |||
737 | } | 737 | } |
738 | EXPORT_SYMBOL(debug_dma_free_coherent); | 738 | EXPORT_SYMBOL(debug_dma_free_coherent); |
739 | 739 | ||
740 | void debug_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, | ||
741 | size_t size, int direction) | ||
742 | { | ||
743 | if (unlikely(global_disable)) | ||
744 | return; | ||
745 | |||
746 | check_sync(dev, dma_handle, size, 0, direction, true); | ||
747 | } | ||
748 | EXPORT_SYMBOL(debug_dma_sync_single_for_cpu); | ||
749 | |||
750 | void debug_dma_sync_single_for_device(struct device *dev, | ||
751 | dma_addr_t dma_handle, size_t size, | ||
752 | int direction) | ||
753 | { | ||
754 | if (unlikely(global_disable)) | ||
755 | return; | ||
756 | |||
757 | check_sync(dev, dma_handle, size, 0, direction, false); | ||
758 | } | ||
759 | EXPORT_SYMBOL(debug_dma_sync_single_for_device); | ||
760 | |||