Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH] drm/xe: Change xe_guc_submit_stop return to void
Date: Wed, 24 Apr 2024 06:00:49 +0000	[thread overview]
Message-ID: <ZiigER6Rj1uLyZon@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20240424041911.2184868-1-himal.prasad.ghimiray@intel.com>

On Wed, Apr 24, 2024 at 09:49:11AM +0530, Himal Prasad Ghimiray wrote:
> The function xe_guc_submit_stop consistently returns 0 without an error
> state, prompting the caller to verify it, which is redundant.
> 
> Cc: Matthew Brost <matthew.brost@intel.com>

Nice cleanup.

Reviewed-by: Matthew Brost <matthew.brost@intel.com>

> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_gt.c         |  4 +---
>  drivers/gpu/drm/xe/xe_guc.c        | 10 ++--------
>  drivers/gpu/drm/xe/xe_guc.h        |  2 +-
>  drivers/gpu/drm/xe/xe_guc_submit.c |  3 +--
>  drivers/gpu/drm/xe/xe_guc_submit.h |  2 +-
>  drivers/gpu/drm/xe/xe_uc.c         | 12 ++++--------
>  drivers/gpu/drm/xe/xe_uc.h         |  2 +-
>  7 files changed, 11 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
> index 491d0413de15..1c661dadd12c 100644
> --- a/drivers/gpu/drm/xe/xe_gt.c
> +++ b/drivers/gpu/drm/xe/xe_gt.c
> @@ -655,9 +655,7 @@ static int gt_reset(struct xe_gt *gt)
>  	xe_uc_stop_prepare(&gt->uc);
>  	xe_gt_pagefault_reset(gt);
>  
> -	err = xe_uc_stop(&gt->uc);
> -	if (err)
> -		goto err_out;
> +	xe_uc_stop(&gt->uc);
>  
>  	xe_gt_tlb_invalidation_reset(gt);
>  
> diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
> index 240e7a4bbff1..4822bf8565b4 100644
> --- a/drivers/gpu/drm/xe/xe_guc.c
> +++ b/drivers/gpu/drm/xe/xe_guc.c
> @@ -891,17 +891,11 @@ void xe_guc_stop_prepare(struct xe_guc *guc)
>  	XE_WARN_ON(xe_guc_pc_stop(&guc->pc));
>  }
>  
> -int xe_guc_stop(struct xe_guc *guc)
> +void xe_guc_stop(struct xe_guc *guc)
>  {
> -	int ret;
> -
>  	xe_guc_ct_stop(&guc->ct);
>  
> -	ret = xe_guc_submit_stop(guc);
> -	if (ret)
> -		return ret;
> -
> -	return 0;
> +	xe_guc_submit_stop(guc);
>  }
>  
>  int xe_guc_start(struct xe_guc *guc)
> diff --git a/drivers/gpu/drm/xe/xe_guc.h b/drivers/gpu/drm/xe/xe_guc.h
> index 94f2dc5f6f90..a3c92b74a3d5 100644
> --- a/drivers/gpu/drm/xe/xe_guc.h
> +++ b/drivers/gpu/drm/xe/xe_guc.h
> @@ -35,7 +35,7 @@ void xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p);
>  int xe_guc_reset_prepare(struct xe_guc *guc);
>  void xe_guc_reset_wait(struct xe_guc *guc);
>  void xe_guc_stop_prepare(struct xe_guc *guc);
> -int xe_guc_stop(struct xe_guc *guc);
> +void xe_guc_stop(struct xe_guc *guc);
>  int xe_guc_start(struct xe_guc *guc);
>  bool xe_guc_in_reset(struct xe_guc *guc);
>  
> diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
> index c7d38469fb46..a0968e3204be 100644
> --- a/drivers/gpu/drm/xe/xe_guc_submit.c
> +++ b/drivers/gpu/drm/xe/xe_guc_submit.c
> @@ -1458,7 +1458,7 @@ void xe_guc_submit_reset_wait(struct xe_guc *guc)
>  	wait_event(guc->ct.wq, !guc_read_stopped(guc));
>  }
>  
> -int xe_guc_submit_stop(struct xe_guc *guc)
> +void xe_guc_submit_stop(struct xe_guc *guc)
>  {
>  	struct xe_exec_queue *q;
>  	unsigned long index;
> @@ -1478,7 +1478,6 @@ int xe_guc_submit_stop(struct xe_guc *guc)
>  	 * creation which is protected by guc->submission_state.lock.
>  	 */
>  
> -	return 0;
>  }
>  
>  static void guc_exec_queue_start(struct xe_exec_queue *q)
> diff --git a/drivers/gpu/drm/xe/xe_guc_submit.h b/drivers/gpu/drm/xe/xe_guc_submit.h
> index fad0421ead36..4275b7da9df5 100644
> --- a/drivers/gpu/drm/xe/xe_guc_submit.h
> +++ b/drivers/gpu/drm/xe/xe_guc_submit.h
> @@ -16,7 +16,7 @@ int xe_guc_submit_init(struct xe_guc *guc);
>  
>  int xe_guc_submit_reset_prepare(struct xe_guc *guc);
>  void xe_guc_submit_reset_wait(struct xe_guc *guc);
> -int xe_guc_submit_stop(struct xe_guc *guc);
> +void xe_guc_submit_stop(struct xe_guc *guc);
>  int xe_guc_submit_start(struct xe_guc *guc);
>  
>  int xe_guc_sched_done_handler(struct xe_guc *guc, u32 *msg, u32 len);
> diff --git a/drivers/gpu/drm/xe/xe_uc.c b/drivers/gpu/drm/xe/xe_uc.c
> index 4feb35c95a1c..0f6cfe06e635 100644
> --- a/drivers/gpu/drm/xe/xe_uc.c
> +++ b/drivers/gpu/drm/xe/xe_uc.c
> @@ -215,13 +215,13 @@ void xe_uc_stop_prepare(struct xe_uc *uc)
>  	xe_guc_stop_prepare(&uc->guc);
>  }
>  
> -int xe_uc_stop(struct xe_uc *uc)
> +void xe_uc_stop(struct xe_uc *uc)
>  {
>  	/* GuC submission not enabled, nothing to do */
>  	if (!xe_device_uc_enabled(uc_to_xe(uc)))
> -		return 0;
> +		return;
>  
> -	return xe_guc_stop(&uc->guc);
> +	xe_guc_stop(&uc->guc);
>  }
>  
>  int xe_uc_start(struct xe_uc *uc)
> @@ -247,17 +247,13 @@ static void uc_reset_wait(struct xe_uc *uc)
>  
>  int xe_uc_suspend(struct xe_uc *uc)
>  {
> -	int ret;
> -
>  	/* GuC submission not enabled, nothing to do */
>  	if (!xe_device_uc_enabled(uc_to_xe(uc)))
>  		return 0;
>  
>  	uc_reset_wait(uc);
>  
> -	ret = xe_uc_stop(uc);
> -	if (ret)
> -		return ret;
> +	xe_uc_stop(uc);
>  
>  	return xe_guc_suspend(&uc->guc);
>  }
> diff --git a/drivers/gpu/drm/xe/xe_uc.h b/drivers/gpu/drm/xe/xe_uc.h
> index e4d4e3c99f0e..5dfa7725483d 100644
> --- a/drivers/gpu/drm/xe/xe_uc.h
> +++ b/drivers/gpu/drm/xe/xe_uc.h
> @@ -16,7 +16,7 @@ int xe_uc_fini_hw(struct xe_uc *uc);
>  void xe_uc_gucrc_disable(struct xe_uc *uc);
>  int xe_uc_reset_prepare(struct xe_uc *uc);
>  void xe_uc_stop_prepare(struct xe_uc *uc);
> -int xe_uc_stop(struct xe_uc *uc);
> +void xe_uc_stop(struct xe_uc *uc);
>  int xe_uc_start(struct xe_uc *uc);
>  int xe_uc_suspend(struct xe_uc *uc);
>  int xe_uc_sanitize_reset(struct xe_uc *uc);
> -- 
> 2.25.1
> 

  parent reply	other threads:[~2024-04-24  6:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24  4:19 [PATCH] drm/xe: Change xe_guc_submit_stop return to void Himal Prasad Ghimiray
2024-04-24  5:50 ` ✓ CI.Patch_applied: success for " Patchwork
2024-04-24  5:50 ` ✓ CI.checkpatch: " Patchwork
2024-04-24  5:51 ` ✓ CI.KUnit: " Patchwork
2024-04-24  6:00 ` Matthew Brost [this message]
2024-04-24  6:03 ` ✓ CI.Build: " Patchwork
2024-04-24  6:06 ` ✓ CI.Hooks: " Patchwork
2024-04-24  6:08 ` ✓ CI.checksparse: " Patchwork
2024-04-24  6:33 ` ✓ CI.BAT: " Patchwork
2024-04-24 20:08 ` ✗ 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=ZiigER6Rj1uLyZon@DUT025-TGLU.fm.intel.com \
    --to=matthew.brost@intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /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