accel/habanalabs: add debug prints to dump content of SG table for dma-buf
authorTomer Tayar <ttayar@habana.ai>
Sun, 20 Aug 2023 23:50:54 +0000 (02:50 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Mon, 9 Oct 2023 09:37:22 +0000 (12:37 +0300)
Add debug prints to dump the content of the SG table which is prepared
when the dma-buf map op is called.

Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/accel/habanalabs/common/memory.c

index 7ddfaf17d15a0b0abe436650c8791b3e1f7c930a..c465dc828b0cd9d54a2f7f2cfeabaa542a2249c1 100644 (file)
@@ -1679,6 +1679,13 @@ static struct sg_table *alloc_sgt_from_device_pages(struct hl_device *hdev, u64
         */
        sgt->orig_nents = 0;
 
+       dev_dbg(hdev->dev, "prepared SG table with %u entries for importer %s\n",
+               nents, dev_name(dev));
+       for_each_sgtable_dma_sg(sgt, sg, i)
+               dev_dbg(hdev->dev,
+                       "SG entry %d: address %#llx, length %#x\n",
+                       i, sg_dma_address(sg), sg_dma_len(sg));
+
        return sgt;
 
 err_unmap: