浏览代码

drm/i915: Be paranoid and bail on resetting if we can't take the lock.

This will declare the machine wedged, but is better than truly wedging
the machine.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Chris Wilson 14 年之前
父节点
当前提交
340479aac6
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      drivers/gpu/drm/i915/i915_drv.c

+ 2 - 1
drivers/gpu/drm/i915/i915_drv.c

@@ -440,7 +440,8 @@ int i915_reset(struct drm_device *dev, u8 flags)
 	bool need_display = true;
 	bool need_display = true;
 	int ret;
 	int ret;
 
 
-	mutex_lock(&dev->struct_mutex);
+	if (!mutex_trylock(&dev->struct_mutex))
+		return -EBUSY;
 
 
 	i915_gem_reset(dev);
 	i915_gem_reset(dev);