Skip to content

Commit

Permalink
drm/i915/gt: Only unwedge if we can reset first
Browse files Browse the repository at this point in the history
Unwedging the GPU requires a successful GPU reset before we restore the
default submission, or else we may see residual context switch events
that we were not expecting.

v2: Pull in the special-case reset_clobbers_display, and explain why it
should be safe in the context of unwedging.

v3: Just forget all about resets before unwedging if it will clobber the
display; risk it all.

Reported-by: Janusz Krzysztofik <[email protected]>
Signed-off-by: Chris Wilson <[email protected]>
Cc: Janusz Krzysztofik <[email protected]>
Cc: Daniele Ceraolo Spurio <[email protected]>
Cc: Ville Syrjälä <[email protected]>
Reviewed-by: Daniele Ceraolo Spurio <[email protected]> #v1
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
ickle authored and bpankajl committed Oct 16, 2019
1 parent c7d35b0 commit 98ef465
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/gpu/drm/i915/gt/intel_reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,7 @@ static bool __intel_gt_unset_wedged(struct intel_gt *gt)
struct intel_gt_timelines *timelines = &gt->timelines;
struct intel_timeline *tl;
unsigned long flags;
bool ok;

if (!test_bit(I915_WEDGED, &gt->reset.flags))
return true;
Expand Down Expand Up @@ -867,7 +868,12 @@ static bool __intel_gt_unset_wedged(struct intel_gt *gt)
}
spin_unlock_irqrestore(&timelines->lock, flags);

intel_gt_sanitize(gt, false);
/* We must reset pending GPU events before restoring our submission */
ok = !HAS_EXECLISTS(gt->i915); /* XXX better agnosticism desired */
if (!INTEL_INFO(gt->i915)->gpu_reset_clobbers_display)
ok = __intel_gt_reset(gt, ALL_ENGINES) == 0;
if (!ok)
return false;

/*
* Undo nop_submit_request. We prevent all new i915 requests from
Expand Down

0 comments on commit 98ef465

Please sign in to comment.