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.br...@intel.com>
---
 drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c 
b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
index 8d45585773f3..3a01743e09ea 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
@@ -1399,10 +1399,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;
-- 
2.32.0

Reply via email to