From: "Christian König" <christian.koenig@amd.com>
To: Chia-I Wu <olvaffe@gmail.com>, dri-devel@lists.freedesktop.org
Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
amd-gfx@lists.freedesktop.org, Daniel Vetter <daniel@ffwll.ch>,
Alex Deucher <alexander.deucher@amd.com>,
David Airlie <airlied@gmail.com>
Subject: Re: [PATCH v2] drm/amdgpu: add a missing lock for AMDGPU_SCHED
Date: Wed, 26 Apr 2023 13:05:33 +0200 [thread overview]
Message-ID: <f889f994-d2cd-fedc-8c95-9c8501037809@amd.com> (raw)
In-Reply-To: <20230426061718.755586-1-olvaffe@gmail.com>
Am 26.04.23 um 08:17 schrieb Chia-I Wu:
> mgr->ctx_handles should be protected by mgr->lock.
>
> v2: improve commit message
>
> Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
> Cc: stable@vger.kernel.org
Please don't manually CC stable@vger.kernel.org while sending patches
out, let us maintainers push that upstream with the appropriate tag and
Greg picking it up from there.
A Fixes tag and figuring out to which stable versions this needs to be
backported are nice to have as well, but Alex and I can take care of
that as well.
Apart from that the technical side of the patch is Reviewed-by:
Christian König <christian.koenig@amd.com>.
Regards,
Christian.
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
> index e9b45089a28a6..863b2a34b2d64 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
> @@ -38,6 +38,7 @@ static int amdgpu_sched_process_priority_override(struct amdgpu_device *adev,
> {
> struct fd f = fdget(fd);
> struct amdgpu_fpriv *fpriv;
> + struct amdgpu_ctx_mgr *mgr;
> struct amdgpu_ctx *ctx;
> uint32_t id;
> int r;
> @@ -51,8 +52,11 @@ static int amdgpu_sched_process_priority_override(struct amdgpu_device *adev,
> return r;
> }
>
> - idr_for_each_entry(&fpriv->ctx_mgr.ctx_handles, ctx, id)
> + mgr = &fpriv->ctx_mgr;
> + mutex_lock(&mgr->lock);
> + idr_for_each_entry(&mgr->ctx_handles, ctx, id)
> amdgpu_ctx_priority_override(ctx, priority);
> + mutex_unlock(&mgr->lock);
>
> fdput(f);
> return 0;
WARNING: multiple messages have this Message-ID (diff)
From: "Christian König" <christian.koenig@amd.com>
To: Chia-I Wu <olvaffe@gmail.com>, dri-devel@lists.freedesktop.org
Cc: stable@vger.kernel.org, Alex Deucher <alexander.deucher@amd.com>,
"Pan, Xinhui" <Xinhui.Pan@amd.com>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] drm/amdgpu: add a missing lock for AMDGPU_SCHED
Date: Wed, 26 Apr 2023 13:05:33 +0200 [thread overview]
Message-ID: <f889f994-d2cd-fedc-8c95-9c8501037809@amd.com> (raw)
In-Reply-To: <20230426061718.755586-1-olvaffe@gmail.com>
Am 26.04.23 um 08:17 schrieb Chia-I Wu:
> mgr->ctx_handles should be protected by mgr->lock.
>
> v2: improve commit message
>
> Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
> Cc: stable@vger.kernel.org
Please don't manually CC stable@vger.kernel.org while sending patches
out, let us maintainers push that upstream with the appropriate tag and
Greg picking it up from there.
A Fixes tag and figuring out to which stable versions this needs to be
backported are nice to have as well, but Alex and I can take care of
that as well.
Apart from that the technical side of the patch is Reviewed-by:
Christian König <christian.koenig@amd.com>.
Regards,
Christian.
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
> index e9b45089a28a6..863b2a34b2d64 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
> @@ -38,6 +38,7 @@ static int amdgpu_sched_process_priority_override(struct amdgpu_device *adev,
> {
> struct fd f = fdget(fd);
> struct amdgpu_fpriv *fpriv;
> + struct amdgpu_ctx_mgr *mgr;
> struct amdgpu_ctx *ctx;
> uint32_t id;
> int r;
> @@ -51,8 +52,11 @@ static int amdgpu_sched_process_priority_override(struct amdgpu_device *adev,
> return r;
> }
>
> - idr_for_each_entry(&fpriv->ctx_mgr.ctx_handles, ctx, id)
> + mgr = &fpriv->ctx_mgr;
> + mutex_lock(&mgr->lock);
> + idr_for_each_entry(&mgr->ctx_handles, ctx, id)
> amdgpu_ctx_priority_override(ctx, priority);
> + mutex_unlock(&mgr->lock);
>
> fdput(f);
> return 0;
WARNING: multiple messages have this Message-ID (diff)
From: "Christian König" <christian.koenig@amd.com>
To: Chia-I Wu <olvaffe@gmail.com>, dri-devel@lists.freedesktop.org
Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
amd-gfx@lists.freedesktop.org,
Alex Deucher <alexander.deucher@amd.com>
Subject: Re: [PATCH v2] drm/amdgpu: add a missing lock for AMDGPU_SCHED
Date: Wed, 26 Apr 2023 13:05:33 +0200 [thread overview]
Message-ID: <f889f994-d2cd-fedc-8c95-9c8501037809@amd.com> (raw)
In-Reply-To: <20230426061718.755586-1-olvaffe@gmail.com>
Am 26.04.23 um 08:17 schrieb Chia-I Wu:
> mgr->ctx_handles should be protected by mgr->lock.
>
> v2: improve commit message
>
> Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
> Cc: stable@vger.kernel.org
Please don't manually CC stable@vger.kernel.org while sending patches
out, let us maintainers push that upstream with the appropriate tag and
Greg picking it up from there.
A Fixes tag and figuring out to which stable versions this needs to be
backported are nice to have as well, but Alex and I can take care of
that as well.
Apart from that the technical side of the patch is Reviewed-by:
Christian König <christian.koenig@amd.com>.
Regards,
Christian.
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
> index e9b45089a28a6..863b2a34b2d64 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
> @@ -38,6 +38,7 @@ static int amdgpu_sched_process_priority_override(struct amdgpu_device *adev,
> {
> struct fd f = fdget(fd);
> struct amdgpu_fpriv *fpriv;
> + struct amdgpu_ctx_mgr *mgr;
> struct amdgpu_ctx *ctx;
> uint32_t id;
> int r;
> @@ -51,8 +52,11 @@ static int amdgpu_sched_process_priority_override(struct amdgpu_device *adev,
> return r;
> }
>
> - idr_for_each_entry(&fpriv->ctx_mgr.ctx_handles, ctx, id)
> + mgr = &fpriv->ctx_mgr;
> + mutex_lock(&mgr->lock);
> + idr_for_each_entry(&mgr->ctx_handles, ctx, id)
> amdgpu_ctx_priority_override(ctx, priority);
> + mutex_unlock(&mgr->lock);
>
> fdput(f);
> return 0;
next prev parent reply other threads:[~2023-04-26 11:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-26 6:17 [PATCH v2] drm/amdgpu: add a missing lock for AMDGPU_SCHED Chia-I Wu
2023-04-26 6:17 ` Chia-I Wu
2023-04-26 6:17 ` Chia-I Wu
2023-04-26 6:42 ` Greg KH
2023-04-26 6:42 ` Greg KH
2023-04-26 6:42 ` Greg KH
2023-04-26 11:05 ` Christian König [this message]
2023-04-26 11:05 ` Christian König
2023-04-26 11:05 ` Christian König
2023-04-26 22:56 ` Chia-I Wu
2023-04-26 22:56 ` Chia-I Wu
2023-04-26 22:56 ` Chia-I Wu
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=f889f994-d2cd-fedc-8c95-9c8501037809@amd.com \
--to=christian.koenig@amd.com \
--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=linux-kernel@vger.kernel.org \
--cc=olvaffe@gmail.com \
--cc=stable@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.