Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Riana Tauro <riana.tauro@intel.com>
Cc: <intel-xe@lists.freedesktop.org>, <anshuman.gupta@intel.com>,
	<rodrigo.vivi@intel.com>, <daniele.ceraolospurio@intel.com>,
	<michal.wajdeczko@intel.com>, <karthik.poosa@intel.com>
Subject: Re: [PATCH v5 1/2] drm/xe: modify GuC CTB enable communication
Date: Thu, 1 Aug 2024 20:34:59 +0000	[thread overview]
Message-ID: <ZqvxcwxbDdyseSxJ@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20240801055941.1187878-2-riana.tauro@intel.com>

On Thu, Aug 01, 2024 at 11:29:40AM +0530, Riana Tauro wrote:
> Modify GuC CTB enable communication function to only set the
> CTB state if registration is not required.
> This will be used while resuming from D3Hot where
> registration of CTB is not necessary.
> 
> v2: split patches (Rodrigo)
> 
> v3: do not expose internals of CT layer (Michal)
> 
> Signed-off-by: Riana Tauro <riana.tauro@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_guc.c | 19 +++++++++++++++----
>  drivers/gpu/drm/xe/xe_guc.h |  2 +-
>  drivers/gpu/drm/xe/xe_uc.c  |  4 ++--
>  3 files changed, 18 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
> index de0fe9e65746..1ff49318f001 100644
> --- a/drivers/gpu/drm/xe/xe_guc.c
> +++ b/drivers/gpu/drm/xe/xe_guc.c
> @@ -755,7 +755,7 @@ static int vf_guc_min_load_for_hwconfig(struct xe_guc *guc)
>  	if (ret)
>  		return ret;
>  
> -	ret = xe_guc_enable_communication(guc);
> +	ret = xe_guc_enable_communication(guc, true);
>  	if (ret)
>  		return ret;
>  
> @@ -800,7 +800,7 @@ int xe_guc_min_load_for_hwconfig(struct xe_guc *guc)
>  	if (ret)
>  		return ret;
>  
> -	ret = xe_guc_enable_communication(guc);
> +	ret = xe_guc_enable_communication(guc, true);
>  	if (ret)
>  		return ret;
>  
> @@ -854,7 +854,16 @@ static void guc_enable_irq(struct xe_guc *guc)
>  	xe_mmio_rmw32(gt, GUC_SG_INTR_MASK, events, 0);
>  }
>  
> -int xe_guc_enable_communication(struct xe_guc *guc)
> +/**
> + * xe_guc_enable_communication - Enable GuC CTB communication
> + * @guc: GuC object
> + * @register_ctb: true to register CTB, false otherwise
> + *
> + * Enables GuC CTB Communication and IRQ
> + *
> + * Return: 0 on success, negative error code otherwise
> + */
> +int xe_guc_enable_communication(struct xe_guc *guc, bool register_ctb)
>  {
>  	struct xe_device *xe = guc_to_xe(guc);
>  	int err;
> @@ -870,7 +879,9 @@ int xe_guc_enable_communication(struct xe_guc *guc)
>  		guc_enable_irq(guc);
>  	}
>  
> -	err = xe_guc_ct_enable(&guc->ct);
> +	if (register_ctb)
> +		err = xe_guc_ct_enable(&guc->ct);
> +
>  	if (err)

err could be unitialized here and I believe some of kernel test robot
scripts will likely complain about this even though it is impossible to
hit in this patch or once the following patch lands.

Matt 

>  		return err;
>  
> diff --git a/drivers/gpu/drm/xe/xe_guc.h b/drivers/gpu/drm/xe/xe_guc.h
> index e0bbf98f849d..13e75573f7d0 100644
> --- a/drivers/gpu/drm/xe/xe_guc.h
> +++ b/drivers/gpu/drm/xe/xe_guc.h
> @@ -20,7 +20,7 @@ int xe_guc_post_load_init(struct xe_guc *guc);
>  int xe_guc_reset(struct xe_guc *guc);
>  int xe_guc_upload(struct xe_guc *guc);
>  int xe_guc_min_load_for_hwconfig(struct xe_guc *guc);
> -int xe_guc_enable_communication(struct xe_guc *guc);
> +int xe_guc_enable_communication(struct xe_guc *guc, bool register_ctb);
>  int xe_guc_suspend(struct xe_guc *guc);
>  void xe_guc_notify(struct xe_guc *guc);
>  int xe_guc_auth_huc(struct xe_guc *guc, u32 rsa_addr);
> diff --git a/drivers/gpu/drm/xe/xe_uc.c b/drivers/gpu/drm/xe/xe_uc.c
> index 0d073a9987c2..fa98e9f22631 100644
> --- a/drivers/gpu/drm/xe/xe_uc.c
> +++ b/drivers/gpu/drm/xe/xe_uc.c
> @@ -154,7 +154,7 @@ static int vf_uc_init_hw(struct xe_uc *uc)
>  	if (err)
>  		return err;
>  
> -	err = xe_guc_enable_communication(&uc->guc);
> +	err = xe_guc_enable_communication(&uc->guc, true);
>  	if (err)
>  		return err;
>  
> @@ -194,7 +194,7 @@ int xe_uc_init_hw(struct xe_uc *uc)
>  	if (ret)
>  		return ret;
>  
> -	ret = xe_guc_enable_communication(&uc->guc);
> +	ret = xe_guc_enable_communication(&uc->guc, true);
>  	if (ret)
>  		return ret;
>  
> -- 
> 2.40.0
> 

  reply	other threads:[~2024-08-01 20:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-01  5:59 [PATCH v5 0/2] drm/xe: remove GuC reload in D3Hot path Riana Tauro
2024-08-01  5:52 ` ✓ CI.Patch_applied: success for drm/xe: remove GuC reload in D3Hot path (rev5) Patchwork
2024-08-01  5:52 ` ✓ CI.checkpatch: " Patchwork
2024-08-01  5:53 ` ✓ CI.KUnit: " Patchwork
2024-08-01  5:59 ` [PATCH v5 1/2] drm/xe: modify GuC CTB enable communication Riana Tauro
2024-08-01 20:34   ` Matthew Brost [this message]
2024-08-01 20:49     ` Matthew Brost
2024-08-01  5:59 ` [PATCH v5 2/2] drm/xe: remove GuC reload in D3Hot path Riana Tauro
2024-08-01 20:42   ` Matthew Brost
2024-08-01 20:55     ` Michal Wajdeczko
2024-08-01 21:02       ` Matthew Brost
2024-08-02  6:21         ` Riana Tauro
2024-08-01  6:05 ` ✓ CI.Build: success for drm/xe: remove GuC reload in D3Hot path (rev5) Patchwork
2024-08-01  6:08 ` ✓ CI.Hooks: " Patchwork
2024-08-01  6:09 ` ✓ CI.checksparse: " Patchwork
2024-08-01  6:29 ` ✓ CI.BAT: " Patchwork
2024-08-01  7:50 ` ✗ 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=ZqvxcwxbDdyseSxJ@DUT025-TGLU.fm.intel.com \
    --to=matthew.brost@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=karthik.poosa@intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@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