We only want to try and reset a wedged device on resume, not before
suspend, so lift the recovery out of the commont gt_sanitize().

Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>
Cc: Andi Shyti <andi.sh...@intel.com>
Cc: Mika Kuoppala <mika.kuopp...@linux.intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt_pm.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c 
b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
index 26241c9c9e38..5a174ec36310 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
@@ -138,17 +138,6 @@ static void gt_sanitize(struct intel_gt *gt, bool force)
        wakeref = intel_runtime_pm_get(gt->uncore->rpm);
        intel_uncore_forcewake_get(gt->uncore, FORCEWAKE_ALL);
 
-       /*
-        * As we have just resumed the machine and woken the device up from
-        * deep PCI sleep (presumably D3_cold), assume the HW has been reset
-        * back to defaults, recovering from whatever wedged state we left it
-        * in and so worth trying to use the device once more.
-        */
-       if (intel_gt_is_wedged(gt))
-               intel_gt_unset_wedged(gt);
-
-       intel_uc_sanitize(&gt->uc);
-
        for_each_engine(engine, gt, id)
                if (engine->reset.prepare)
                        engine->reset.prepare(engine);
@@ -195,7 +184,19 @@ int intel_gt_resume(struct intel_gt *gt)
        intel_gt_pm_get(gt);
 
        intel_uncore_forcewake_get(gt->uncore, FORCEWAKE_ALL);
+
        intel_rc6_sanitize(&gt->rc6);
+       intel_uc_sanitize(&gt->uc);
+
+       /*
+        * As we have just resumed the machine and woken the device up from
+        * deep PCI sleep (presumably D3_cold), assume the HW has been reset
+        * back to defaults, recovering from whatever wedged state we left it
+        * in and so worth trying to use the device once more.
+        */
+       if (intel_gt_is_wedged(gt))
+               intel_gt_unset_wedged(gt);
+
        gt_sanitize(gt, true);
        if (intel_gt_is_wedged(gt)) {
                err = -EIO;
-- 
2.25.0.rc2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to