[PATCH 6/7] drm/xe: Cleanup extra calls to xe_hw_fence_irq_finish()

Rodrigo Vivi rodrigo.vivi at intel.com
Mon Feb 3 21:46:03 UTC 2025


On Fri, Jan 31, 2025 at 02:31:39PM -0800, Lucas De Marchi wrote:
> Now that xe_gt_remove is handled entirely by xe_gt, it's clear there are
> some extra calls to xe_hw_fence_irq_finish() that aren't necessary.
> Neither all_fw_domain_init() or gt_fw_domain_init() need to do that
> since it's handled by the caller on any error.

I remember having bumped into this code a while ago and having
the feeling it was duplicated...  but at least it all makes sense now...


Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>

> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_gt.c | 15 ++++-----------
>  1 file changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
> index 48f6fd8c14b65..b05a0f27cc88c 100644
> --- a/drivers/gpu/drm/xe/xe_gt.c
> +++ b/drivers/gpu/drm/xe/xe_gt.c
> @@ -388,13 +388,11 @@ static void dump_pat_on_error(struct xe_gt *gt)
>  static int gt_fw_domain_init(struct xe_gt *gt)
>  {
>  	unsigned int fw_ref;
> -	int err, i;
> +	int err;
>  
>  	fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
> -	if (!fw_ref) {
> -		err = -ETIMEDOUT;
> -		goto err_hw_fence_irq;
> -	}
> +	if (!fw_ref)
> +		return -ETIMEDOUT;
>  
>  	if (!xe_gt_is_media_type(gt)) {
>  		err = xe_ggtt_init(gt_to_tile(gt)->mem.ggtt);
> @@ -435,9 +433,6 @@ static int gt_fw_domain_init(struct xe_gt *gt)
>  err_force_wake:
>  	dump_pat_on_error(gt);
>  	xe_force_wake_put(gt_to_fw(gt), fw_ref);
> -err_hw_fence_irq:
> -	for (i = 0; i < XE_ENGINE_CLASS_MAX; ++i)
> -		xe_hw_fence_irq_finish(&gt->fence_irq[i]);
>  
>  	return err;
>  }
> @@ -445,7 +440,7 @@ static int gt_fw_domain_init(struct xe_gt *gt)
>  static int all_fw_domain_init(struct xe_gt *gt)
>  {
>  	unsigned int fw_ref;
> -	int err, i;
> +	int err;
>  
>  	fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL);
>  	if (!xe_force_wake_ref_has_domain(fw_ref, XE_FORCEWAKE_ALL)) {
> @@ -523,8 +518,6 @@ static int all_fw_domain_init(struct xe_gt *gt)
>  
>  err_force_wake:
>  	xe_force_wake_put(gt_to_fw(gt), fw_ref);
> -	for (i = 0; i < XE_ENGINE_CLASS_MAX; ++i)
> -		xe_hw_fence_irq_finish(&gt->fence_irq[i]);
>  
>  	return err;
>  }
> -- 
> 2.48.0
> 


More information about the Intel-xe mailing list