From patchwork Mon Sep 18 14:31:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 13389722 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 42A17CD37B0 for ; Mon, 18 Sep 2023 14:32:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 954A110E290; Mon, 18 Sep 2023 14:32:35 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7B33110E190 for ; Mon, 18 Sep 2023 14:32:15 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 037ADB80E3D; Mon, 18 Sep 2023 14:32:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE07BC32788; Mon, 18 Sep 2023 14:32:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695047533; bh=H+SspTrUvoR2QTMJuVAGKvR7+leUmqiHwlWLm0zDOc4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dZgpsW+oahqq0e59ohFRHXyoMNIr0+t1VL3dMNee+JmKLPT+P6X0jqTBGfMnAHKjO gA/jzz6N+UBOvY1bAStC3lra2taBnBzR+18xSL9j3HSViiVPRhprmEsyVx4IIz9cug 7yLitHWq/GClSEzVuUJOuO3WAfPZCkBpfEbx/fDQzWJmO5AomM126N8TxuIE8RMWRU LLriBtTiLiw5rN4rMOXsn4B1Q0MYGa/T+yi9l8R35Iefpl6xQaf8zWog0HoKvr+E8f EqZd3z0nJfDWXJj+aXr2gUA5thWI0BwavEKUE6jZH5CF8FZtg2f+o5lQZUvpVyeksE 61hMRyGe/Sf3Q== From: Oded Gabbay To: dri-devel@lists.freedesktop.org Subject: [PATCH 07/10] accel/habanalabs: add debug prints to dump content of SG table for dma-buf Date: Mon, 18 Sep 2023 17:31:55 +0300 Message-Id: <20230918143158.903207-7-ogabbay@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230918143158.903207-1-ogabbay@kernel.org> References: <20230918143158.903207-1-ogabbay@kernel.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomer Tayar Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Tomer Tayar 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 Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- drivers/accel/habanalabs/common/memory.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/accel/habanalabs/common/memory.c b/drivers/accel/habanalabs/common/memory.c index 00e73b5573be..33fb78aba812 100644 --- a/drivers/accel/habanalabs/common/memory.c +++ b/drivers/accel/habanalabs/common/memory.c @@ -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: