From: "Christian König" <christian.koenig@amd.com>
To: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>,
amd-gfx@lists.freedesktop.org
Cc: alexander.deucher@amd.com
Subject: Re: [PATCH 2/5] drm/amdgpu/userq: Add lock before accessing dma_fence_is_signaled_locked
Date: Fri, 2 May 2025 14:35:59 +0200 [thread overview]
Message-ID: <4deadb8a-ea39-402c-90f2-ecfa8a10b025@amd.com> (raw)
In-Reply-To: <20250409054831.2411-2-Arunpravin.PaneerSelvam@amd.com>
On 4/9/25 07:48, Arunpravin Paneer Selvam wrote:
> Add lock before accessing dma_fence_is_signaled_locked.
>
> Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
> index 24d19b920100..d5b35b5df527 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
> @@ -259,11 +259,13 @@ static int amdgpu_userq_fence_create(struct amdgpu_usermode_queue *userq,
>
> /* Check if hardware has already processed the job */
> spin_lock_irqsave(&fence_drv->fence_list_lock, flags);
> + spin_lock_nested(fence->lock, SINGLE_DEPTH_NESTING);
That is clear incorrect use of spin_lock_nested(). Why does a normal spinlock() doesn't work?
Regards,
Christian.
> if (!dma_fence_is_signaled_locked(fence))
> list_add_tail(&userq_fence->link, &fence_drv->fences);
> else
> dma_fence_put(fence);
>
> + spin_unlock(fence->lock);
> spin_unlock_irqrestore(&fence_drv->fence_list_lock, flags);
>
> *f = fence;
next prev parent reply other threads:[~2025-05-02 12:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-09 5:48 [PATCH 1/5] drm/amdgpu/userq: Fix lock contention in userq fence Arunpravin Paneer Selvam
2025-04-09 5:48 ` [PATCH 2/5] drm/amdgpu/userq: Add lock before accessing dma_fence_is_signaled_locked Arunpravin Paneer Selvam
2025-05-02 12:35 ` Christian König [this message]
2025-04-09 5:48 ` [PATCH 3/5] drm/amdgpu: Fix userq ttm_bo_pin and ttm_bo_unpin lockdep warnings Arunpravin Paneer Selvam
2025-05-02 12:42 ` Christian König
2025-05-12 1:36 ` Zhang, Jesse(Jie)
2025-04-09 5:48 ` [PATCH 4/5] drm/amdgpu/userq: Fix DEBUG_LOCKS_WARN_ON(lock->magic != lock) Arunpravin Paneer Selvam
2025-05-02 13:02 ` Christian König
2025-04-09 5:48 ` [PATCH 5/5] drm/amdgpu: Acquire BO locks only during BO processing Arunpravin Paneer Selvam
2025-05-02 13:07 ` Christian König
2025-05-02 12:30 ` [PATCH 1/5] drm/amdgpu/userq: Fix lock contention in userq fence Christian König
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=4deadb8a-ea39-402c-90f2-ecfa8a10b025@amd.com \
--to=christian.koenig@amd.com \
--cc=Arunpravin.PaneerSelvam@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.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.