lkml.org 
[lkml]   [2023]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] drm:amd:amdgpu: Fix missing bo unlock in failure path
From
Am 24.04.23 um 07:59 schrieb Sukrut Bellary:
> smatch warning - inconsistent handling of buffer object reserve
> and unreserve.
>
> Signed-off-by: Sukrut Bellary <sukrut.bellary@linux.com>

For now that patch is Reviewed-by: Christian König
<christian.koenig@amd.com>.

But for the record mapping/unmapping the MQD like this is a very bad
idea in the first place.

We could need to shuffle memory around for that during resume and that
is not something we really want to do.

Christian.

> ---
> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> index 278416acf060..5de44d7e92de 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> @@ -4686,8 +4686,10 @@ static int gfx_v8_0_kiq_resume(struct amdgpu_device *adev)
> return r;
>
> r = amdgpu_bo_kmap(ring->mqd_obj, &ring->mqd_ptr);
> - if (unlikely(r != 0))
> + if (unlikely(r != 0)) {
> + amdgpu_bo_unreserve(ring->mqd_obj);
> return r;
> + }
>
> gfx_v8_0_kiq_init_queue(ring);
> amdgpu_bo_kunmap(ring->mqd_obj);

\
 
 \ /
  Last update: 2023-04-24 09:08    [W:0.831 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site