lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220905105653.13670-3-Arvind.Yadav@amd.com>
Date:   Mon, 5 Sep 2022 16:26:51 +0530
From:   Arvind Yadav <Arvind.Yadav@....com>
To:     <Christian.Koenig@....com>, <andrey.grodzovsky@....com>,
        <shashank.sharma@....com>, <amaranath.somalapuram@....com>,
        <Arunpravin.PaneerSelvam@....com>, <sumit.semwal@...aro.org>,
        <gustavo@...ovan.org>, <airlied@...ux.ie>, <daniel@...ll.ch>,
        <linux-media@...r.kernel.org>, <dri-devel@...ts.freedesktop.org>,
        <linaro-mm-sig@...ts.linaro.org>, <linux-kernel@...r.kernel.org>
CC:     Arvind Yadav <Arvind.Yadav@....com>
Subject: [PATCH 2/4] drm/sched: Add callback and enable signaling on debug

Here's on debug adding an enable_signaling callback for finished
fences and enabling software signaling for finished fence.

Signed-off-by: Arvind Yadav <Arvind.Yadav@....com>
---
 drivers/gpu/drm/scheduler/sched_fence.c | 12 ++++++++++++
 drivers/gpu/drm/scheduler/sched_main.c  |  4 +++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/scheduler/sched_fence.c b/drivers/gpu/drm/scheduler/sched_fence.c
index 7fd869520ef2..ebd26cdb79a0 100644
--- a/drivers/gpu/drm/scheduler/sched_fence.c
+++ b/drivers/gpu/drm/scheduler/sched_fence.c
@@ -122,16 +122,28 @@ static void drm_sched_fence_release_finished(struct dma_fence *f)
 
 	dma_fence_put(&fence->scheduled);
 }
+#ifdef CONFIG_DEBUG_FS
+static bool drm_sched_enable_signaling(struct dma_fence *f)
+{
+	return true;
+}
+#endif
 
 static const struct dma_fence_ops drm_sched_fence_ops_scheduled = {
 	.get_driver_name = drm_sched_fence_get_driver_name,
 	.get_timeline_name = drm_sched_fence_get_timeline_name,
+#ifdef CONFIG_DEBUG_FS
+	.enable_signaling = drm_sched_enable_signaling,
+#endif
 	.release = drm_sched_fence_release_scheduled,
 };
 
 static const struct dma_fence_ops drm_sched_fence_ops_finished = {
 	.get_driver_name = drm_sched_fence_get_driver_name,
 	.get_timeline_name = drm_sched_fence_get_timeline_name,
+#ifdef CONFIG_DEBUG_FS
+	.enable_signaling = drm_sched_enable_signaling,
+#endif
 	.release = drm_sched_fence_release_finished,
 };
 
diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
index e0ab14e0fb6b..140e3d8646e2 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -961,7 +961,9 @@ static int drm_sched_main(void *param)
 			s_fence->parent = dma_fence_get(fence);
 			/* Drop for original kref_init of the fence */
 			dma_fence_put(fence);
-
+#ifdef CONFIG_DEBUG_FS
+			dma_fence_enable_sw_signaling(&s_fence->finished);
+#endif
 			r = dma_fence_add_callback(fence, &sched_job->cb,
 						   drm_sched_job_done_cb);
 			if (r == -ENOENT)
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ