From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Andrey Grodzovsky <andrey.grodzovsky@amd.com>,
amd-gfx@lists.freedesktop.org
Cc: Alexander.Deucher@amd.com
Subject: Re: [PATCH 1/2] drm/amdgpu: Fix sigsev when accessing MMIO on hot unplug.
Date: Wed, 2 Mar 2022 09:37:57 +0100 [thread overview]
Message-ID: <09402cd4-8cc2-2ec2-e239-823bae762c1f@gmail.com> (raw)
In-Reply-To: <20220301180800.1781042-1-andrey.grodzovsky@amd.com>
Am 01.03.22 um 19:07 schrieb Andrey Grodzovsky:
> Protect with drm_dev_enter/exit
>
> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com> for this one here.
Regarding the version bumb you should probably sync up with Alex.
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> index f522b52725e4..4294f17cedcb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> @@ -23,6 +23,7 @@
> */
>
> #include <drm/drm_auth.h>
> +#include <drm/drm_drv.h>
> #include "amdgpu.h"
> #include "amdgpu_sched.h"
> #include "amdgpu_ras.h"
> @@ -339,7 +340,7 @@ static void amdgpu_ctx_fini(struct kref *ref)
> {
> struct amdgpu_ctx *ctx = container_of(ref, struct amdgpu_ctx, refcount);
> struct amdgpu_device *adev = ctx->adev;
> - unsigned i, j;
> + unsigned i, j, idx;
>
> if (!adev)
> return;
> @@ -350,7 +351,12 @@ static void amdgpu_ctx_fini(struct kref *ref)
> ctx->entities[i][j] = NULL;
> }
> }
> - amdgpu_ctx_set_stable_pstate(ctx, AMDGPU_CTX_STABLE_PSTATE_NONE);
> +
> + if (drm_dev_enter(&adev->ddev, &idx)) {
> + amdgpu_ctx_set_stable_pstate(ctx, AMDGPU_CTX_STABLE_PSTATE_NONE);
> + drm_dev_exit(idx);
> + }
> +
> kfree(ctx);
> }
>
next prev parent reply other threads:[~2022-03-02 8:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-01 18:07 [PATCH 1/2] drm/amdgpu: Fix sigsev when accessing MMIO on hot unplug Andrey Grodzovsky
2022-03-01 18:08 ` [PATCH 2/2] drm/amdgpu: Bump minor version for hot plug tests enabliing Andrey Grodzovsky
2022-03-01 18:34 ` Alex Deucher
2022-03-02 8:37 ` Christian König [this message]
2022-03-02 17:49 ` [PATCH 1/2] drm/amdgpu: Fix sigsev when accessing MMIO on hot unplug Andrey Grodzovsky
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=09402cd4-8cc2-2ec2-e239-823bae762c1f@gmail.com \
--to=ckoenig.leichtzumerken@gmail.com \
--cc=Alexander.Deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=andrey.grodzovsky@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