Commit 662d19e7 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Drop mutex around clearing error state

The error state itself is guarded by a spinlock (admittedly even that is
overkill for a single pointer!) and doesn't require us to take the
struct_mutex in the debugfs/sysfs interface. Removing the struct_mutex
removes one more potential blockage when trying to debug a deadlock.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/20160901205510.31307-1-chris@chris-wilson.co.uk
Reviewed-by: David Weinehall <david.weinehall@linux.intel.com
parent c4a8a7c7
...@@ -978,17 +978,9 @@ i915_error_state_write(struct file *filp, ...@@ -978,17 +978,9 @@ i915_error_state_write(struct file *filp,
loff_t *ppos) loff_t *ppos)
{ {
struct i915_error_state_file_priv *error_priv = filp->private_data; struct i915_error_state_file_priv *error_priv = filp->private_data;
struct drm_device *dev = error_priv->dev;
int ret;
DRM_DEBUG_DRIVER("Resetting error state\n"); DRM_DEBUG_DRIVER("Resetting error state\n");
i915_destroy_error_state(error_priv->dev);
ret = mutex_lock_interruptible(&dev->struct_mutex);
if (ret)
return ret;
i915_destroy_error_state(dev);
mutex_unlock(&dev->struct_mutex);
return cnt; return cnt;
} }
......
...@@ -556,17 +556,9 @@ static ssize_t error_state_write(struct file *file, struct kobject *kobj, ...@@ -556,17 +556,9 @@ static ssize_t error_state_write(struct file *file, struct kobject *kobj,
{ {
struct device *kdev = kobj_to_dev(kobj); struct device *kdev = kobj_to_dev(kobj);
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev); struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
struct drm_device *dev = &dev_priv->drm;
int ret;
DRM_DEBUG_DRIVER("Resetting error state\n"); DRM_DEBUG_DRIVER("Resetting error state\n");
i915_destroy_error_state(&dev_priv->drm);
ret = mutex_lock_interruptible(&dev->struct_mutex);
if (ret)
return ret;
i915_destroy_error_state(dev);
mutex_unlock(&dev->struct_mutex);
return count; return count;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment