aboutsummaryrefslogtreecommitdiff
path: root/kernel/dma/debug.c
AgeCommit message (Collapse)AuthorFilesLines
2018-12-11dma-debug: Expose nr_total_entries in debugfsRobin Murphy1-0/+7
Expose nr_total_entries in debugfs, so that {num,min}_free_entries become even more meaningful to users interested in current/maximum utilisation. This becomes even more relevant once nr_total_entries may change at runtime beyond just the existing AMD GART debug code. Suggested-by: John Garry <[email protected]> Signed-off-by: Robin Murphy <[email protected]> Tested-by: Qian Cai <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2018-10-08dma-debug: Check for drivers mapping invalid addresses in dma_map_single()Stephen Boyd1-0/+16
I recently debugged a DMA mapping oops where a driver was trying to map a buffer returned from request_firmware() with dma_map_single(). Memory returned from request_firmware() is mapped into the vmalloc region and this isn't a valid region to map with dma_map_single() per the DMA documentation's "What memory is DMA'able?" section. Unfortunately, we don't really check that in the DMA debugging code, so enabling DMA debugging doesn't help catch this problem. Let's add a new DMA debug function to check for a vmalloc address or an invalid virtual address and print a warning if this happens. This makes it a little easier to debug these sorts of problems, instead of seeing odd behavior or crashes when drivers attempt to map the vmalloc space for DMA. Cc: Marek Szyprowski <[email protected]> Reviewed-by: Robin Murphy <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2018-06-14dma-mapping: move all DMA mapping code to kernel/dmaChristoph Hellwig1-0/+1773
Currently the code is split over various files with dma- prefixes in the lib/ and drives/base directories, and the number of files keeps growing. Move them into a single directory to keep the code together and remove the file name prefixes. To match the irq infrastructure this directory is placed under the kernel/ directory. Signed-off-by: Christoph Hellwig <[email protected]>