Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe: Ignore GGTT TLB inval errors during GT reset
@ 2024-11-12 16:29 Nirmoy Das
  2024-11-12 17:28 ` Matthew Brost
  0 siblings, 1 reply; 2+ messages in thread
From: Nirmoy Das @ 2024-11-12 16:29 UTC (permalink / raw)
  To: intel-xe; +Cc: Nirmoy Das, Matthew Brost

During GT reset, GGTT TLB invalidations may fail. This is acceptable
as the reset will clear GGTT caches. Suppress only -ECANCELED other
return codes are still unexpected error.

Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/3389
Suggested-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
index 3cb228c773cd..acd6ec535ef9 100644
--- a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
+++ b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
@@ -253,9 +253,14 @@ static int xe_gt_tlb_invalidation_guc(struct xe_gt *gt,
 		0,  /* seqno, replaced in send_tlb_invalidation */
 		MAKE_INVAL_OP(XE_GUC_TLB_INVAL_GUC),
 	};
+	int ret;
+
+	ret = send_tlb_invalidation(&gt->uc.guc, fence, action,
+				    ARRAY_SIZE(action));
+	if (ret == -ECANCELED)
+		return 0;
 
-	return send_tlb_invalidation(&gt->uc.guc, fence, action,
-				     ARRAY_SIZE(action));
+	return ret;
 }
 
 /**
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/xe: Ignore GGTT TLB inval errors during GT reset
  2024-11-12 16:29 [PATCH] drm/xe: Ignore GGTT TLB inval errors during GT reset Nirmoy Das
@ 2024-11-12 17:28 ` Matthew Brost
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Brost @ 2024-11-12 17:28 UTC (permalink / raw)
  To: Nirmoy Das; +Cc: intel-xe

On Tue, Nov 12, 2024 at 05:29:34PM +0100, Nirmoy Das wrote:
> During GT reset, GGTT TLB invalidations may fail. This is acceptable
> as the reset will clear GGTT caches. Suppress only -ECANCELED other
> return codes are still unexpected error.
> 
> Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/3389
> Suggested-by: Matthew Brost <matthew.brost@intel.com>
> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
> index 3cb228c773cd..acd6ec535ef9 100644
> --- a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
> +++ b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
> @@ -253,9 +253,14 @@ static int xe_gt_tlb_invalidation_guc(struct xe_gt *gt,
>  		0,  /* seqno, replaced in send_tlb_invalidation */
>  		MAKE_INVAL_OP(XE_GUC_TLB_INVAL_GUC),
>  	};
> +	int ret;
> +
> +	ret = send_tlb_invalidation(&gt->uc.guc, fence, action,
> +				    ARRAY_SIZE(action));

Add a comment along the lines of '-ECANCELED indicates the CT is stopped
for a GT reset in which the TLB caches should be nuked'.

Otherwise LGTM.

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

> +	if (ret == -ECANCELED)
> +		return 0;
>  
> -	return send_tlb_invalidation(&gt->uc.guc, fence, action,
> -				     ARRAY_SIZE(action));
> +	return ret;
>  }
>  
>  /**
> -- 
> 2.46.0
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-12 17:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-12 16:29 [PATCH] drm/xe: Ignore GGTT TLB inval errors during GT reset Nirmoy Das
2024-11-12 17:28 ` Matthew Brost

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox