From: Matthew Brost <matthew.brost@intel.com>
To: Nirmoy Das <nirmoy.das@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH] drm/xe/ufence: Wake up waiters after setting ufence->signalled
Date: Thu, 14 Nov 2024 08:17:15 -0800 [thread overview]
Message-ID: <ZzYii99fHXfiWQ/L@lstrano-desk.jf.intel.com> (raw)
In-Reply-To: <20241114150537.4161573-1-nirmoy.das@intel.com>
On Thu, Nov 14, 2024 at 04:05:37PM +0100, Nirmoy Das wrote:
> If a previous ufence is not signalled, vm_bind will return -EBUSY.
> Delaying the modification of ufence->signalled can cause issues if the
> UMD reuses the same ufence so update ufence->signalled before waking up
> waiters.
>
> Cc: Matthew Brost <matthew.brost@intel.com>
> Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/3233
Do we need a fixes tag?
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
> drivers/gpu/drm/xe/xe_sync.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_sync.c b/drivers/gpu/drm/xe/xe_sync.c
> index a90480c6aecf..42f5bebd09e5 100644
> --- a/drivers/gpu/drm/xe/xe_sync.c
> +++ b/drivers/gpu/drm/xe/xe_sync.c
> @@ -87,8 +87,12 @@ static void user_fence_worker(struct work_struct *w)
> drm_dbg(&ufence->xe->drm, "mmget_not_zero() failed, ufence wasn't signaled\n");
> }
>
> - wake_up_all(&ufence->xe->ufence_wq);
> + /*
> + * Wake up waiters only after updating the ufence state, allowing the UMD
> + * to safely reuse the same ufence without encountering -EBUSY errors.
> + */
> WRITE_ONCE(ufence->signalled, 1);
> + wake_up_all(&ufence->xe->ufence_wq);
> user_fence_put(ufence);
> }
>
> --
> 2.46.0
>
next prev parent reply other threads:[~2024-11-14 16:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-14 15:05 [PATCH] drm/xe/ufence: Wake up waiters after setting ufence->signalled Nirmoy Das
2024-11-14 16:17 ` Matthew Brost [this message]
2024-11-14 16:22 ` Nirmoy Das
2024-11-14 17:40 ` ✓ CI.Patch_applied: success for " Patchwork
2024-11-14 17:41 ` ✓ CI.checkpatch: " Patchwork
2024-11-14 17:42 ` ✓ CI.KUnit: " Patchwork
2024-11-14 17:53 ` ✓ CI.Build: " Patchwork
2024-11-14 17:56 ` ✓ CI.Hooks: " Patchwork
2024-11-14 17:57 ` ✓ CI.checksparse: " Patchwork
2024-11-14 18:23 ` ✓ CI.BAT: " Patchwork
2024-11-15 11:21 ` ✗ CI.FULL: failure " Patchwork
2024-11-15 13:21 ` Nirmoy Das
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=ZzYii99fHXfiWQ/L@lstrano-desk.jf.intel.com \
--to=matthew.brost@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=nirmoy.das@intel.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