The patch titled Subject: dma-debug: check nents in dma_sync_sg* has been added to the -mm tree. Its filename is dma-debug-check-nents-in-dma_sync_sg.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/dma-debug-check-nents-in-dma_sync_sg.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/dma-debug-check-nents-in-dma_sync_sg.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Robin Murphy <robin.murphy@xxxxxxx> Subject: 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@xxxxxxx> Cc: Arnd Bergmann <arnd@xxxxxxxx> Cc: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx> Cc: Sumit Semwal <sumit.semwal@xxxxxxxxxx> Cc: Sakari Ailus <sakari.ailus@xxxxxx> Cc: Russell King <rmk+kernel@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/dma-debug.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff -puN lib/dma-debug.c~dma-debug-check-nents-in-dma_sync_sg lib/dma-debug.c --- a/lib/dma-debug.c~dma-debug-check-nents-in-dma_sync_sg +++ a/lib/dma-debug.c @@ -1249,6 +1249,14 @@ static void check_sync(struct device *de 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); } _ Patches currently in -mm which might be from robin.murphy@xxxxxxx are dmapool-fix-overflow-condition-in-pool_find_page.patch dma-mapping-tidy-up-dma_parms-default-handling.patch dma-debug-check-nents-in-dma_sync_sg.patch dma-debug-allow-poisoning-nonzero-allocations.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html