Skip to contentSkip to conversation

drm/amdgpu: update sched.ready within kernel drm scheduler

PATCH In review Guchun Chen 1 participant 2 messages Jul 19, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: update sched.ready within kernel drm scheduler

amdgpu_test_ring_helper will set sched.ready unconditionally based on ring test result, this will lead value mismatch between ring->sched.ready and no_scheduler for those rings without a kernel scheluer, after they perform ring test. This will be confused as kernel ring no_scheduler is true, but ring->sched.ready is true as well.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +3 -1
index 80d6e132e409..afa76d069d94 100644
@@ -630,7 +630,9 @@ int amdgpu_ring_test_helper(struct amdgpu_ring *ring)
 		DRM_DEV_DEBUG(adev->dev, "ring test on %s succeeded\n",
 			      ring->name);
 
-	ring->sched.ready = !r;
+	/* Only set sched.ready on top of kernel scheduler. */
+	if (!ring->no_scheduler)
+		ring->sched.ready = !r;
 	return r;
 }
 
Signature · 1 line
2.25.1
#1 lore raw

[Public]

Please ignore this patch, will send another one after more rework is done.

Regards,
Guchun

Quoted 41 lines

-----Original Message-----
From: Chen, Guchun <[email protected]>
Sent: Wednesday, July 19, 2023 12:52 PM
To: [email protected]; Deucher, Alexander <[email protected]>; Zhang, Hawking <[email protected]>; Koenig, Christian <[email protected]>; Lazar, Lijo <[email protected]>
Cc: Chen, Guchun <[email protected]>
Subject: [PATCH] drm/amdgpu: update sched.ready within kernel drm scheduler

amdgpu_test_ring_helper will set sched.ready unconditionally based on ring test result, this will lead value mismatch between ring->sched.ready and no_scheduler for those rings without a kernel scheluer, after they perform ring test. This will be confused as kernel ring no_scheduler is true, but ring->sched.ready is true as well.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +3 -2
index 80d6e132e409..afa76d069d94 100644
@@ -630,7 +630,9 @@ int amdgpu_ring_test_helper(struct amdgpu_ring
 *ring)
              DRM_DEV_DEBUG(adev->dev, "ring test on %s succeeded\n",
                            ring->name);
 
-     ring->sched.ready = !r;
+     /* Only set sched.ready on top of kernel scheduler. */
+     if (!ring->no_scheduler)
+             ring->sched.ready = !r;
      return r;
 }
 
--

2.25.1