Skip to content

Commit

Permalink
drm/i915: Skip error capture when wedged on init
Browse files Browse the repository at this point in the history
Trying to capture uninitialised engines when we wedged on init ends in
tears. Skip that together with uC capture, since failure to initialise the
latter can actually be one of the reasons for wedging on init.

v2:
 * Use i915_disable_error_state when wedging on init/fini.

v3:
 * Handle mock tests.

Signed-off-by: Tvrtko Ursulin <[email protected]>
Reviewed-by: Matthew Auld <[email protected]> # v1
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
tursulin committed Nov 16, 2021
1 parent fac7354 commit 9a7fc95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/i915/gt/intel_reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,7 @@ void intel_gt_set_wedged_on_init(struct intel_gt *gt)
BUILD_BUG_ON(I915_RESET_ENGINE + I915_NUM_ENGINES >
I915_WEDGED_ON_INIT);
intel_gt_set_wedged(gt);
i915_disable_error_state(gt->i915, -ENODEV);
set_bit(I915_WEDGED_ON_INIT, &gt->reset.flags);

/* Wedged on init is non-recoverable */
Expand All @@ -1457,6 +1458,7 @@ void intel_gt_set_wedged_on_init(struct intel_gt *gt)
void intel_gt_set_wedged_on_fini(struct intel_gt *gt)
{
intel_gt_set_wedged(gt);
i915_disable_error_state(gt->i915, -ENODEV);
set_bit(I915_WEDGED_ON_FINI, &gt->reset.flags);
intel_gt_retire_requests(gt); /* cleanup any wedged requests */
}
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/i915/selftests/mock_gem_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ struct drm_i915_private *mock_gem_device(void)

mock_uncore_init(&i915->uncore, i915);

spin_lock_init(&i915->gpu_error.lock);

i915_gem_init__mm(i915);
intel_gt_init_early(&i915->gt, i915);
atomic_inc(&i915->gt.wakeref.count); /* disable; no hw support */
Expand Down

0 comments on commit 9a7fc95

Please sign in to comment.