mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Sukrut Bellary <sukrut.bellary@linux.com>,
	daniel@ffwll.ch, airlied@gmail.com, sumit.semwal@linaro.org,
	Hawking.Zhang@amd.com, Julia.Lawall@inria.fr,
	dri-devel@lists.freedesktop.org
Cc: alexander.deucher@amd.com, Xinhui.Pan@amd.com,
	amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org
Subject: Re: [PATCH] drm:amd:amdgpu: Fix missing bo unlock in failure path
Date: Mon, 24 Apr 2023 09:07:02 +0200	[thread overview]
Message-ID: <ecc972c1-cf7d-cd99-805b-38dbf04adc79@amd.com> (raw)
In-Reply-To: <20230424055910.15683-1-sukrut.bellary@linux.com>

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);


  reply	other threads:[~2023-04-24  7:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-24  5:59 Sukrut Bellary
2023-04-24  7:07 ` Christian König [this message]
2023-04-24 15:01   ` Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ecc972c1-cf7d-cd99-805b-38dbf04adc79@amd.com \
    --to=christian.koenig@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=Julia.Lawall@inria.fr \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=sukrut.bellary@linux.com \
    --cc=sumit.semwal@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®