mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 21:21:09 +00:00
dma-debug: New interfaces to debug dma mapping errors
Add dma-debug interface debug_dma_mapping_error() to debug drivers that fail to check dma mapping errors on addresses returned by dma_map_single() and dma_map_page() interfaces. This interface clears a flag set by debug_dma_map_page() to indicate that dma_mapping_error() has been called by the driver. When driver does unmap, debug_dma_unmap() checks the flag and if this flag is still set, prints warning message that includes call trace that leads up to the unmap. This interface can be called from dma_mapping_error() routines to enable dma mapping error check debugging. Tested: Intel iommu and swiotlb (iommu=soft) on x86-64 with CONFIG_DMA_API_DEBUG enabled and disabled. Signed-off-by: Shuah Khan <shuah.khan@hp.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
This commit is contained in:
parent
6f0c0580b7
commit
6c9c6d6301
4 changed files with 87 additions and 4 deletions
|
@ -39,6 +39,8 @@ extern void debug_dma_map_page(struct device *dev, struct page *page,
|
|||
int direction, dma_addr_t dma_addr,
|
||||
bool map_single);
|
||||
|
||||
extern void debug_dma_mapping_error(struct device *dev, dma_addr_t dma_addr);
|
||||
|
||||
extern void debug_dma_unmap_page(struct device *dev, dma_addr_t addr,
|
||||
size_t size, int direction, bool map_single);
|
||||
|
||||
|
@ -105,6 +107,11 @@ static inline void debug_dma_map_page(struct device *dev, struct page *page,
|
|||
{
|
||||
}
|
||||
|
||||
static inline void debug_dma_mapping_error(struct device *dev,
|
||||
dma_addr_t dma_addr)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void debug_dma_unmap_page(struct device *dev, dma_addr_t addr,
|
||||
size_t size, int direction,
|
||||
bool map_single)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue