[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <c725a1746c556d8aa532a53a5f30bb2005a9ddae.1443178314.git.robin.murphy@arm.com>
Date: Fri, 25 Sep 2015 13:15:45 +0100
From: Robin Murphy <robin.murphy@....com>
To: akpm@...ux-foundation.org, linux-kernel@...r.kernel.org
Cc: arnd@...db.de, m.szyprowski@...sung.com, sumit.semwal@...aro.org,
sakari.ailus@....fi, linux-arch@...r.kernel.org,
linux-mm@...ck.org, linux-arm-kernel@...ts.infradead.org
Subject: [PATCH 3/4] 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@....com>
---
lib/dma-debug.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index dace71f..908fb35 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);
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists