From: Chris Wilson Date: Sat, 4 Dec 2010 18:17:15 +0000 (+0000) Subject: drm/i915: Be paranoid and bail on resetting if we can't take the lock. X-Git-Tag: v2.6.38-rc1~419^2~23^2~40 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=340479aac697bc73e225c122a9753d4964eeda3f;p=karo-tx-linux.git 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 --- 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) bool need_display = true; int ret; - mutex_lock(&dev->struct_mutex); + if (!mutex_trylock(&dev->struct_mutex)) + return -EBUSY; i915_gem_reset(dev);