AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Leslie Shi <Yuliang.Shi@amd.com>,
	amd-gfx@lists.freedesktop.org, hawking.zhang@amd.com
Cc: guchun.chen@amd.com
Subject: Re: [PATCH] drm/amdgpu: fix gart.bo pin_count leak
Date: Thu, 23 Sep 2021 10:49:50 +0200	[thread overview]
Message-ID: <84d319a1-4e15-5cb7-d5f9-b0010bfc17a2@gmail.com> (raw)
In-Reply-To: <20210923081618.74243-1-Yuliang.Shi@amd.com>

Am 23.09.21 um 10:16 schrieb Leslie Shi:
> gmc_v{9,10}_0_gart_disable() isn't called matched with
> correspoding gart_enbale function in SRIOV case. This will
> lead to gart.bo pin_count leak on driver unload.
>
> Cc: Hawking Zhang <Hawking.Zhang@amd.com>
> Signed-off-by: Leslie Shi <Yuliang.Shi@amd.com>
> Signed-off-by: Guchun Chen <guchun.chen@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 3 ++-
>   drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c  | 3 ++-
>   2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
> index 41c3a0d70b7c..e47104a1f559 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
> @@ -1098,6 +1098,8 @@ static int gmc_v10_0_hw_fini(void *handle)
>   {
>   	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>   
> +	gmc_v10_0_gart_disable(adev);
> +
>   	if (amdgpu_sriov_vf(adev)) {
>   		/* full access mode, so don't touch any GMC register */
>   		DRM_DEBUG("For SRIOV client, shouldn't do anything.\n");
> @@ -1106,7 +1108,6 @@ static int gmc_v10_0_hw_fini(void *handle)
>   
>   	amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0);
>   	amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0);
> -	gmc_v10_0_gart_disable(adev);
>   
>   	return 0;
>   }
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> index d90c16a6b2b8..5551359d5dfd 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> @@ -1794,6 +1794,8 @@ static int gmc_v9_0_hw_fini(void *handle)
>   {
>   	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>   
> +	gmc_v9_0_gart_disable(adev);
> +
>   	if (amdgpu_sriov_vf(adev)) {
>   		/* full access mode, so don't touch any GMC register */
>   		DRM_DEBUG("For SRIOV client, shouldn't do anything.\n");
> @@ -1802,7 +1804,6 @@ static int gmc_v9_0_hw_fini(void *handle)
>   
>   	amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0);
>   	amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0);
> -	gmc_v9_0_gart_disable(adev);
>   
>   	return 0;
>   }


      reply	other threads:[~2021-09-23  8:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23  8:16 [PATCH] drm/amdgpu: fix gart.bo pin_count leak Leslie Shi
2021-09-23  8:49 ` Christian König [this message]

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=84d319a1-4e15-5cb7-d5f9-b0010bfc17a2@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=Yuliang.Shi@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=guchun.chen@amd.com \
    --cc=hawking.zhang@amd.com \
    /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