From eedcbb6fa56c77584df4107a8168065230c9d044 Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Tue, 18 Aug 2015 17:38:50 -0300 Subject: [PATCH] drm/i915/XXX: fixes for igt/gem_eio/throttle Not-signed-off-by: Paulo Zanoni --- drivers/gpu/drm/i915/i915_debugfs.c | 7 +++++++ drivers/gpu/drm/i915/i915_irq.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 7a28de5..d9cde5a 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -4566,6 +4566,13 @@ i915_wedged_set(void *data, u64 val) struct drm_i915_private *dev_priv = dev->dev_private; /* + * FIXME: IGT calls this even when we're terminally wedged, but our + * driver has no way to undo the I915_WEDGED flag, so avoid the infinite + * -EAGAIN case. + */ + atomic_clear_mask(I915_WEDGED, &dev_priv->gpu_error.reset_counter); + + /* * There is no safeguard against this debugfs entry colliding * with the hangcheck calling same i915_handle_error() in * parallel, causing an explosion. For now we assume that the diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index a051045..6d4c85d 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -2226,6 +2226,9 @@ static void i915_reset_and_wakeup(struct drm_device *dev) kobject_uevent_env(&dev->primary->kdev->kobj, KOBJ_CHANGE, reset_done_event); } else { + /* Increment the counter so we don't stay with a "reset + * in progress" forever. */ + atomic_inc(&dev_priv->gpu_error.reset_counter); atomic_set_mask(I915_WEDGED, &error->reset_counter); } -- 2.4.6