AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>,
	amd-gfx@lists.freedesktop.org
Cc: christian.koenig@amd.com, alexander.deucher@amd.com
Subject: Re: [PATCH v2 02/08] drm/amdgpu: screen freeze and userq driver crash
Date: Thu, 26 Sep 2024 13:38:40 +0200	[thread overview]
Message-ID: <0653d0fe-9b43-4038-a605-2f0ec9e27855@gmail.com> (raw)
In-Reply-To: <20240925195928.142001-2-Arunpravin.PaneerSelvam@amd.com>

Am 25.09.24 um 21:59 schrieb Arunpravin Paneer Selvam:
> Screen freeze and userq fence driver crash while playing Xonotic
>
> v2: (Christian)
>      - There is change that fence might signal in between testing
>        and grabbing the lock. Hence we can move the lock above the
>        if..else check and use the dma_fence_is_signaled_locked().
>
> Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>

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

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
> index 96d1caf4c815..97b1af574407 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
> @@ -185,6 +185,7 @@ int amdgpu_userq_fence_create(struct amdgpu_usermode_queue *userq,
>   	struct amdgpu_userq_fence_driver *fence_drv;
>   	struct amdgpu_userq_fence *userq_fence;
>   	struct dma_fence *fence;
> +	unsigned long flags;
>   
>   	fence_drv = userq->fence_drv;
>   	if (!fence_drv)
> @@ -232,14 +233,14 @@ int amdgpu_userq_fence_create(struct amdgpu_usermode_queue *userq,
>   		userq_fence->fence_drv_array_count = 0;
>   	}
>   
> -	spin_lock(&fence_drv->fence_list_lock);
>   	/* Check if hardware has already processed the job */
> -	if (!dma_fence_is_signaled(fence))
> +	spin_lock_irqsave(&fence_drv->fence_list_lock, flags);
> +	if (!dma_fence_is_signaled_locked(fence))
>   		list_add_tail(&userq_fence->link, &fence_drv->fences);
>   	else
>   		dma_fence_put(fence);
>   
> -	spin_unlock(&fence_drv->fence_list_lock);
> +	spin_unlock_irqrestore(&fence_drv->fence_list_lock, flags);
>   
>   	*f = fence;
>   


  reply	other threads:[~2024-09-26 11:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25 19:59 [PATCH v2 01/08] drm/amdgpu: Implement userqueue signal/wait IOCTL Arunpravin Paneer Selvam
2024-09-25 19:59 ` [PATCH v2 02/08] drm/amdgpu: screen freeze and userq driver crash Arunpravin Paneer Selvam
2024-09-26 11:38   ` Christian König [this message]
2024-09-25 19:59 ` [PATCH v2 03/08] drm/amdgpu: Add wait IOCTL timeline syncobj support Arunpravin Paneer Selvam
2024-09-26 11:49   ` Christian König
2024-09-25 19:59 ` [PATCH v2 04/08] drm/amdgpu: Enable userq fence interrupt support Arunpravin Paneer Selvam
2024-09-25 19:59 ` [PATCH v2 05/08] drm/amdgpu: Remove the MES self test Arunpravin Paneer Selvam
2024-09-25 19:59 ` [PATCH v2 06/08] drm/amdgpu: Add few optimizations to userq fence driver Arunpravin Paneer Selvam
2024-09-26 12:28   ` Christian König
2024-09-25 19:59 ` [PATCH v2 07/08] drm/amdgpu: Add the missing error handling for xa_store() call Arunpravin Paneer Selvam
2024-09-26 12:29   ` Christian König
2024-09-25 19:59 ` [PATCH v2 08/08] drm/amdgpu: add vm root BO lock before accessing the vm Arunpravin Paneer Selvam
2024-09-26 12:32   ` Christian König
2024-09-26  9:27 ` [PATCH v2 01/08] drm/amdgpu: Implement userqueue signal/wait IOCTL Christian König
2024-09-26  9:31   ` Paneer Selvam, Arunpravin
2024-09-26  9:34     ` Christian König
2024-09-26 10:26       ` Paneer Selvam, Arunpravin
2024-09-26 11:16         ` 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=0653d0fe-9b43-4038-a605-2f0ec9e27855@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=Arunpravin.PaneerSelvam@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@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