drm/i915/guc: Reset LRC descriptor if register returns -ENODEV
authorMatthew Brost <matthew.brost@intel.com>
Thu, 9 Sep 2021 16:47:35 +0000 (09:47 -0700)
committerJohn Harrison <John.C.Harrison@Intel.com>
Mon, 13 Sep 2021 18:30:43 +0000 (11:30 -0700)
Reset LRC descriptor if a context register returns -ENODEV as this means
we are mid-reset.

Fixes: eb5e7da736f3 ("drm/i915/guc: Reset implementation for new GuC interface")
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210909164744.31249-15-matthew.brost@intel.com
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c

index ca73128d7b4d5007d4486df20e101900906d7bbe..dcd7a09f8559fecb149971a66ea1e9dc348c58c1 100644 (file)
@@ -1405,10 +1405,12 @@ static int guc_lrc_desc_pin(struct intel_context *ce, bool loop)
        } else {
                with_intel_runtime_pm(runtime_pm, wakeref)
                        ret = register_context(ce, loop);
-               if (unlikely(ret == -EBUSY))
+               if (unlikely(ret == -EBUSY)) {
+                       reset_lrc_desc(guc, desc_idx);
+               } else if (unlikely(ret == -ENODEV)) {
                        reset_lrc_desc(guc, desc_idx);
-               else if (unlikely(ret == -ENODEV))
                        ret = 0;        /* Will get registered later */
+               }
        }
 
        return ret;