Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Summers, Stuart" <stuart.summers@intel.com>
To: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
	"Cavitt, Jonathan" <jonathan.cavitt@intel.com>
Cc: "Gupta, Saurabhg" <saurabhg.gupta@intel.com>,
	"Zuo, Alex" <alex.zuo@intel.com>
Subject: Re: [PATCH v2] drm/xe/xe_guc_ct: Exit CT submission fence wait on GT reset
Date: Tue, 6 Jan 2026 19:37:36 +0000	[thread overview]
Message-ID: <dfdceca79ef128c36515cdaf6f6d934b6ec56a62.camel@intel.com> (raw)
In-Reply-To: <20251223230248.59814-2-jonathan.cavitt@intel.com>

On Tue, 2025-12-23 at 23:02 +0000, Jonathan Cavitt wrote:
> It's possible if unlikely that the GuC could be reset in the time
> between performing a guc_ct_send and the G2H fence completing in
> guc_ct_send_recv.  Exit early if this is occurs.
> 
> v2: Rebase
> 
> Suggested-by: Stuart Summers <stuart.summers@intel.com>
> Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_guc_ct.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c
> b/drivers/gpu/drm/xe/xe_guc_ct.c
> index dfbf76037b04..64ac985867ae 100644
> --- a/drivers/gpu/drm/xe/xe_guc_ct.c
> +++ b/drivers/gpu/drm/xe/xe_guc_ct.c
> @@ -1238,6 +1238,10 @@ int xe_guc_ct_send_g2h_handler(struct
> xe_guc_ct *ct, const u32 *action, u32 len)
>         return ret;
>  }
>  
> +#define ct_alive(ct)    \
> +       (xe_guc_ct_enabled(ct) && !ct->ctbs.h2g.info.broken && \
> +        !ct->ctbs.g2h.info.broken)
> +
>  /*
>   * Check if a GT reset is in progress or will occur and if GT reset
> brought the
>   * CT back up. Randomly picking 5 seconds for an upper limit to do a
> GT a reset.
> @@ -1247,12 +1251,8 @@ static bool retry_failure(struct xe_guc_ct
> *ct, int ret)
>         if (!(ret == -EDEADLK || ret == -EPIPE || ret == -ENODEV))
>                 return false;
>  
> -#define ct_alive(ct)   \
> -       (xe_guc_ct_enabled(ct) && !ct->ctbs.h2g.info.broken && \
> -        !ct->ctbs.g2h.info.broken)
>         if (!wait_event_interruptible_timeout(ct->wq, ct_alive(ct),
> HZ * 5))
>                 return false;
> -#undef ct_alive
>  
>         return true;
>  }
> @@ -1304,7 +1304,8 @@ static int guc_ct_send_recv(struct xe_guc_ct
> *ct, const u32 *action, u32 len,
>         /* READ_ONCEs pairs with WRITE_ONCEs in parse_g2h_response
>          * and g2h_fence_cancel.
>          */
> -       ret = wait_event_timeout(ct->g2h_fence_wq,
> READ_ONCE(g2h_fence.done), HZ);
> +       ret = wait_event_timeout(ct->g2h_fence_wq, !ct_alive(ct) ||

So I think we want to do something similar here to what we had done
with the guc_ct_send() call above - basically jump back to
retry_same_fence to retry again if !ct_alive. The idea being that GuC
should eventually recover after the reset and begin accepting
communication.

Thanks,
Stuart

> +                                READ_ONCE(g2h_fence.done), HZ);
>         if (!ret) {
>                 LNL_FLUSH_WORK(&ct->g2h_worker);
>                 if (READ_ONCE(g2h_fence.done)) {


      parent reply	other threads:[~2026-01-06 19:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-23 23:02 [PATCH v2] drm/xe/xe_guc_ct: Exit CT submission fence wait on GT reset Jonathan Cavitt
2025-12-23 23:08 ` ✗ CI.checkpatch: warning for drm/xe/xe_guc_ct: Exit CT submission fence wait on GT reset (rev2) Patchwork
2025-12-23 23:09 ` ✓ CI.KUnit: success " Patchwork
2025-12-23 23:52 ` ✓ Xe.CI.BAT: " Patchwork
2025-12-24  9:45 ` ✓ Xe.CI.Full: " Patchwork
2026-01-06 19:37 ` Summers, Stuart [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=dfdceca79ef128c36515cdaf6f6d934b6ec56a62.camel@intel.com \
    --to=stuart.summers@intel.com \
    --cc=alex.zuo@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jonathan.cavitt@intel.com \
    --cc=saurabhg.gupta@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