AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/amdgpu: Fix a race of IB test
@ 2021-09-12 23:48 xinhui pan
  2021-09-13  4:00 ` Lazar, Lijo
  2021-09-13 14:41 ` Andrey Grodzovsky
  0 siblings, 2 replies; 13+ messages in thread
From: xinhui pan @ 2021-09-12 23:48 UTC (permalink / raw)
  To: amd-gfx; +Cc: alexander.deucher, christian.koenig, xinhui pan

Direct IB submission should be exclusive. So use write lock.

Signed-off-by: xinhui pan <xinhui.pan@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index 19323b4cce7b..be5d12ed3db1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -1358,7 +1358,7 @@ static int amdgpu_debugfs_test_ib_show(struct seq_file *m, void *unused)
 	}
 
 	/* Avoid accidently unparking the sched thread during GPU reset */
-	r = down_read_killable(&adev->reset_sem);
+	r = down_write_killable(&adev->reset_sem);
 	if (r)
 		return r;
 
@@ -1387,7 +1387,7 @@ static int amdgpu_debugfs_test_ib_show(struct seq_file *m, void *unused)
 		kthread_unpark(ring->sched.thread);
 	}
 
-	up_read(&adev->reset_sem);
+	up_write(&adev->reset_sem);
 
 	pm_runtime_mark_last_busy(dev->dev);
 	pm_runtime_put_autosuspend(dev->dev);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-09-13 14:41 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-12 23:48 [PATCH v2] drm/amdgpu: Fix a race of IB test xinhui pan
2021-09-13  4:00 ` Lazar, Lijo
2021-09-13  4:42   ` 回复: " Pan, Xinhui
2021-09-13  6:22     ` Christian König
2021-09-13  6:25       ` Lazar, Lijo
2021-09-13  6:37         ` Christian König
2021-09-13  6:43           ` Lazar, Lijo
2021-09-13  6:51             ` Christian König
2021-09-13  7:15               ` Lazar, Lijo
2021-09-13  7:22                 ` Christian König
2021-09-13  7:23                 ` 回复: " Pan, Xinhui
2021-09-13 13:50                   ` Lazar, Lijo
2021-09-13 14:41 ` Andrey Grodzovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox