[PATCH 2/3] drm/i915: Make GT initalisation errors permanent across all GT

Nirmoy Das nirmoy.das at intel.com
Mon Jan 30 16:36:21 UTC 2023


From: Chris Wilson <chris.p.wilson at linux.intel.com>

If we fail to initialise the first GT, we leave the second GT
ninitialised but marked as unavailable (wedged). However, we didn't
ake that permanent and try to remove the wedged condition for IGT and
hen attempt to use the uninitialised GT and execute its NULL vfuncs.

Signed-off-by: Chris Wilson <chris.p.wilson at linux.intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
---
 drivers/gpu/drm/i915/gt/intel_reset.c |  2 ++
 drivers/gpu/drm/i915/i915_gem.c       | 10 +++-------
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_reset.c b/drivers/gpu/drm/i915/gt/intel_reset.c
index 0bb9094fdacd..9d2d74e22ce0 100644
--- a/drivers/gpu/drm/i915/gt/intel_reset.c
+++ b/drivers/gpu/drm/i915/gt/intel_reset.c
@@ -955,6 +955,8 @@ void intel_gt_set_wedged(struct intel_gt *gt)
 	__intel_gt_set_wedged(gt);
 
 	mutex_unlock(&gt->reset.mutex);
+
+	intel_gt_retire_requests(gt);
 	intel_runtime_pm_put(gt->uncore->rpm, wakeref);
 }
 
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 35950fa91406..3af9b661d492 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1205,13 +1205,9 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
 		 * as wedged. But we only want to do this when the GPU is angry,
 		 * for all other failure, such as an allocation failure, bail.
 		 */
-		for_each_gt(gt, dev_priv, i) {
-			if (!intel_gt_is_wedged(gt)) {
-				i915_probe_error(dev_priv,
-						 "Failed to initialize GPU, declaring it wedged!\n");
-				intel_gt_set_wedged(gt);
-			}
-		}
+		for_each_gt(gt, dev_priv, i)
+			/* Make any cross-tile error permanent */
+			intel_gt_set_wedged_on_init(gt);
 
 		/* Minimal basic recovery for KMS */
 		ret = i915_ggtt_enable_hw(dev_priv);
-- 
2.39.0



More information about the Intel-gfx-trybot mailing list