mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-05-03 20:07:24 -04:00
drm/i915: Prevent machine hang from Broxton's vtd w/a and error capture
Since capturing the error state requires fiddling around with the GGTT
to read arbitrary buffers and is itself run under stop_machine(), it
deadlocks the machine (effectively a hard hang) when run in conjunction
with Broxton's VTd workaround to serialize GGTT access.
v2: Store the ERR_PTR in first_error so that the error can be reported
to the user via sysfs.
v3: Mention the quirk in dmesg (using info as per usual)
Fixes: 0ef34ad622 ("drm/i915: Serialize GTT/Aperture accesses on BXT")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jon Bloomfield <jon.bloomfield@intel.com>
Cc: John Harrison <john.C.Harrison@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181102161232.17742-5-chris@chris-wilson.co.uk
This commit is contained in:
@@ -648,6 +648,9 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (IS_ERR(error))
|
||||
return PTR_ERR(error);
|
||||
|
||||
if (*error->error_msg)
|
||||
err_printf(m, "%s\n", error->error_msg);
|
||||
err_printf(m, "Kernel: " UTS_RELEASE "\n");
|
||||
@@ -1867,6 +1870,7 @@ void i915_capture_error_state(struct drm_i915_private *i915,
|
||||
error = i915_capture_gpu_state(i915);
|
||||
if (!error) {
|
||||
DRM_DEBUG_DRIVER("out of memory, not capturing error state\n");
|
||||
i915_disable_error_state(i915, -ENOMEM);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1922,5 +1926,14 @@ void i915_reset_error_state(struct drm_i915_private *i915)
|
||||
i915->gpu_error.first_error = NULL;
|
||||
spin_unlock_irq(&i915->gpu_error.lock);
|
||||
|
||||
i915_gpu_state_put(error);
|
||||
if (!IS_ERR(error))
|
||||
i915_gpu_state_put(error);
|
||||
}
|
||||
|
||||
void i915_disable_error_state(struct drm_i915_private *i915, int err)
|
||||
{
|
||||
spin_lock_irq(&i915->gpu_error.lock);
|
||||
if (!i915->gpu_error.first_error)
|
||||
i915->gpu_error.first_error = ERR_PTR(err);
|
||||
spin_unlock_irq(&i915->gpu_error.lock);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user