Skip to contentSkip to conversation

drm/xe: Ignore GGTT TLB inval errors during GT reset

PATCH Superseded Nirmoy Das 2 participants 2 messages Nov 12, 2024

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Nirmoy Das

author
#0 lore raw

PATCH 1/1 drm/xe: Ignore GGTT TLB inval errors during GT reset

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.

---
 drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +7 -2
index 3cb228c773cd..acd6ec535ef9 100644
@@ -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;
 }
 
 /**
Signature · 1 line
2.46.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Nirmoy Das

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.

---
 drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +0 -0
index 3cb228c773cd..acd6ec535ef9 100644

drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c static int xe_gt_tlb_invalidation_guc(struct xe_gt *gt, · line 259

Quoted 7 lines
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +4 -0
@@ -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.

Quoted 12 lines
drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c +3 -2
+	if (ret == -ECANCELED)
+		return 0;
 
-	return send_tlb_invalidation(&gt->uc.guc, fence, action,
-				     ARRAY_SIZE(action));
+	return ret;
 }
 
 /**
Signature · 1 line
2.46.0