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

Chen, Guchun Guchun.Chen at amd.com
Wed Jul 19 05:10:36 UTC 2023


[Public]

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

Regards,
Guchun

> -----Original Message-----
> From: Chen, Guchun <Guchun.Chen at amd.com>
> Sent: Wednesday, July 19, 2023 12:52 PM
> To: amd-gfx at lists.freedesktop.org; Deucher, Alexander
> <Alexander.Deucher at amd.com>; Zhang, Hawking
> <Hawking.Zhang at amd.com>; Koenig, Christian
> <Christian.Koenig at amd.com>; Lazar, Lijo <Lijo.Lazar at amd.com>
> Cc: Chen, Guchun <Guchun.Chen at amd.com>
> 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.
>
> Signed-off-by: Guchun Chen <guchun.chen at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> index 80d6e132e409..afa76d069d94 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> @@ -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



More information about the amd-gfx mailing list