intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Raag Jadav <raag.jadav@intel.com>,
	Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: <lucas.demarchi@intel.com>, <intel-xe@lists.freedesktop.org>,
	<riana.tauro@intel.com>, <daniele.ceraolospurio@intel.com>,
	<matthew.brost@intel.com>, <michal.wajdeczko@intel.com>
Subject: Re: [PATCH v4 1/2] drm/xe/guc: Split xe_guc_ct_enable()
Date: Wed, 10 Sep 2025 12:51:58 -0400	[thread overview]
Message-ID: <aMGsrqDj2qUh3G7b@intel.com> (raw)
In-Reply-To: <20250904091439.2279352-2-raag.jadav@intel.com>

On Thu, Sep 04, 2025 at 02:44:38PM +0530, Raag Jadav wrote:
> In preparation of usecases which require dynamically enabling GuC CT state,
> split xe_guc_ct_enable().
> 
> Suggested-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Signed-off-by: Raag Jadav <raag.jadav@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_guc.c    |  2 +-
>  drivers/gpu/drm/xe/xe_guc_ct.c | 34 ++++++++++++++++++++++++++--------
>  drivers/gpu/drm/xe/xe_guc_ct.h |  3 ++-
>  3 files changed, 29 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
> index b3a6408a5760..fd82eef8f372 100644
> --- a/drivers/gpu/drm/xe/xe_guc.c
> +++ b/drivers/gpu/drm/xe/xe_guc.c
> @@ -1355,7 +1355,7 @@ int xe_guc_enable_communication(struct xe_guc *guc)
>  		guc_enable_irq(guc);
>  	}
>  
> -	err = xe_guc_ct_enable(&guc->ct);
> +	err = xe_guc_ct_register(&guc->ct);
>  	if (err)
>  		return err;
>  
> diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c
> index e431ff73227c..f2b2db780e53 100644
> --- a/drivers/gpu/drm/xe/xe_guc_ct.c
> +++ b/drivers/gpu/drm/xe/xe_guc_ct.c
> @@ -504,7 +504,31 @@ static void ct_exit_safe_mode(struct xe_guc_ct *ct)
>  		xe_gt_dbg(ct_to_gt(ct), "GuC CT safe-mode disabled\n");
>  }
>  
> -int xe_guc_ct_enable(struct xe_guc_ct *ct)
> +/**
> + * xe_guc_ct_enable() - Enable GuC CT
> + * @ct: the &xe_guc_ct
> + *
> + * Set GuC CT to enabled state and ready to send/received new messages.
> + */
> +void xe_guc_ct_enable(struct xe_guc_ct *ct)
> +{
> +	guc_ct_change_state(ct, XE_GUC_CT_STATE_ENABLED);
> +
> +	smp_mb();
> +	wake_up_all(&ct->wq);
> +
> +	ct_enter_safe_mode(ct);

Where is the  if (ct_needs_safe_mode(ct)) ?
This change is not mentioned in the commit message and might have
implications specially on initialization and SRIOV flows?!

Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>


> +}
> +
> +/**
> + * xe_guc_ct_register() - Register GuC CT
> + * @ct: the &xe_guc_ct
> + *
> + * Initialize and register H2G and G2H CTBs and enable GuC CT.
> + *
> + * Return: 0 on success, negative error code otherwise.
> + */
> +int xe_guc_ct_register(struct xe_guc_ct *ct)
>  {
>  	struct xe_device *xe = ct_to_xe(ct);
>  	struct xe_gt *gt = ct_to_gt(ct);
> @@ -528,13 +552,7 @@ int xe_guc_ct_enable(struct xe_guc_ct *ct)
>  	if (err)
>  		goto err_out;
>  
> -	guc_ct_change_state(ct, XE_GUC_CT_STATE_ENABLED);
> -
> -	smp_mb();
> -	wake_up_all(&ct->wq);
> -
> -	if (ct_needs_safe_mode(ct))
> -		ct_enter_safe_mode(ct);
> +	xe_guc_ct_enable(ct);
>  
>  #if IS_ENABLED(CONFIG_DRM_XE_DEBUG)
>  	/*
> diff --git a/drivers/gpu/drm/xe/xe_guc_ct.h b/drivers/gpu/drm/xe/xe_guc_ct.h
> index cf41210ab30a..c821517e87d0 100644
> --- a/drivers/gpu/drm/xe/xe_guc_ct.h
> +++ b/drivers/gpu/drm/xe/xe_guc_ct.h
> @@ -14,8 +14,9 @@ struct xe_device;
>  int xe_guc_ct_init_noalloc(struct xe_guc_ct *ct);
>  int xe_guc_ct_init(struct xe_guc_ct *ct);
>  int xe_guc_ct_init_post_hwconfig(struct xe_guc_ct *ct);
> -int xe_guc_ct_enable(struct xe_guc_ct *ct);
> +void xe_guc_ct_enable(struct xe_guc_ct *ct);
>  void xe_guc_ct_disable(struct xe_guc_ct *ct);
> +int xe_guc_ct_register(struct xe_guc_ct *ct);
>  void xe_guc_ct_stop(struct xe_guc_ct *ct);
>  void xe_guc_ct_fast_path(struct xe_guc_ct *ct);
>  
> -- 
> 2.34.1
> 

  reply	other threads:[~2025-09-10 16:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04  9:14 [PATCH v4 0/2] Introduce GT runtime suspend/resume Raag Jadav
2025-09-04  9:14 ` [PATCH v4 1/2] drm/xe/guc: Split xe_guc_ct_enable() Raag Jadav
2025-09-10 16:51   ` Rodrigo Vivi [this message]
2025-09-04  9:14 ` [PATCH v4 2/2] drm/xe/gt: Introduce runtime suspend/resume Raag Jadav
2025-10-01 16:46   ` Daniele Ceraolo Spurio
2025-10-02 16:22     ` Raag Jadav
2025-10-02 16:53       ` Daniele Ceraolo Spurio
2025-10-04  6:39         ` Raag Jadav
2025-09-04  9:31 ` ✗ CI.checkpatch: warning for Introduce GT " Patchwork
2025-09-04  9:32 ` ✓ CI.KUnit: success " Patchwork
2025-09-04 10:08 ` ✓ Xe.CI.BAT: " Patchwork
2025-09-04 21:01 ` ✗ Xe.CI.Full: failure " Patchwork

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=aMGsrqDj2qUh3G7b@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=raag.jadav@intel.com \
    --cc=riana.tauro@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;
as well as URLs for NNTP newsgroup(s).