From: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
To: "Christian König" <ckoenig.leichtzumerken@gmail.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 12:49:32 -0500 [thread overview]
Message-ID: <f93dc8c0-d698-2ba5-6801-3ba3f19460d4@amd.com> (raw)
In-Reply-To: <09402cd4-8cc2-2ec2-e239-823bae762c1f@gmail.com>
Thanks, already did. Code pushed both here and in libdrm.
Andrey
On 2022-03-02 03:37, Christian König wrote:
> 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);
>> }
>
prev parent reply other threads:[~2022-03-02 17:49 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 ` [PATCH 1/2] drm/amdgpu: Fix sigsev when accessing MMIO on hot unplug Christian König
2022-03-02 17:49 ` Andrey Grodzovsky [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=f93dc8c0-d698-2ba5-6801-3ba3f19460d4@amd.com \
--to=andrey.grodzovsky@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=ckoenig.leichtzumerken@gmail.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