diff options
author | Robin Murphy <robin.murphy@arm.com> | 2015-11-06 16:32:55 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-06 17:50:42 -0800 |
commit | 7f8306429c4c75f9e2bf39fcfe990b0af2f7292d (patch) | |
tree | 3fcd7b9d5c61e287914b2e576ac662eccc8c701e /lib/dma-debug.c | |
parent | 002edb6f6f2a79bea50de11260ddc9572e6db731 (diff) | |
download | op-kernel-dev-7f8306429c4c75f9e2bf39fcfe990b0af2f7292d.zip op-kernel-dev-7f8306429c4c75f9e2bf39fcfe990b0af2f7292d.tar.gz |
dma-debug: check nents in dma_sync_sg*
Like dma_unmap_sg, dma_sync_sg* should be called with the original number
of entries passed to dma_map_sg, so do the same check in the sync path as
we do in the unmap path.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/dma-debug.c')
-rw-r--r-- | lib/dma-debug.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/dma-debug.c b/lib/dma-debug.c index fcb65d2..8855f01 100644 --- a/lib/dma-debug.c +++ b/lib/dma-debug.c @@ -1249,6 +1249,14 @@ static void check_sync(struct device *dev, dir2name[entry->direction], dir2name[ref->direction]); + if (ref->sg_call_ents && ref->type == dma_debug_sg && + ref->sg_call_ents != entry->sg_call_ents) { + err_printk(ref->dev, entry, "DMA-API: device driver syncs " + "DMA sg list with different entry count " + "[map count=%d] [sync count=%d]\n", + entry->sg_call_ents, ref->sg_call_ents); + } + out: put_hash_bucket(bucket, &flags); } |