aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-12-04 13:17:15 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2010-12-04 19:37:38 -0500
commit340479aac697bc73e225c122a9753d4964eeda3f (patch)
treed7ae627640d4c964c6090aa18daae3d22a223be1
parent4add75c43f39573edc884d46b7c2b7414f01171a (diff)
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>
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 1a15b7886b8c..64844e2e9f86 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -440,7 +440,8 @@ int i915_reset(struct drm_device *dev, u8 flags)
440 bool need_display = true; 440 bool need_display = true;
441 int ret; 441 int ret;
442 442
443 mutex_lock(&dev->struct_mutex); 443 if (!mutex_trylock(&dev->struct_mutex))
444 return -EBUSY;
444 445
445 i915_gem_reset(dev); 446 i915_gem_reset(dev);
446 447