From 0903de0c8f7d2566c1bd65600142a71572eec07e Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 3 Jun 2008 21:49:51 -0700 Subject: Drop struct_mutex while waiting in drm_client_lock_take struct_mutex cannot be held while blocking on DRM lock. --- linux-core/drm_lock.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'linux-core') diff --git a/linux-core/drm_lock.c b/linux-core/drm_lock.c index 58c5f08d..e6eae42b 100644 --- a/linux-core/drm_lock.c +++ b/linux-core/drm_lock.c @@ -393,6 +393,7 @@ int drm_client_lock_take(struct drm_device *dev, struct drm_file *file_priv) if (drm_i_have_hw_lock(dev, file_priv)) return 0; + mutex_unlock (&dev->struct_mutex); /* Client doesn't hold the lock. Block taking the lock with the kernel * context on behalf of the client, and return whether we were * successful. @@ -407,15 +408,15 @@ int drm_client_lock_take(struct drm_device *dev, struct drm_file *file_priv) dev->lock.user_waiters--; if (ret != 0) { spin_unlock_irqrestore(&dev->lock.spinlock, irqflags); - return ret; } else { dev->lock.file_priv = file_priv; dev->lock.lock_time = jiffies; dev->lock.kernel_held = 1; file_priv->lock_count++; spin_unlock_irqrestore(&dev->lock.spinlock, irqflags); - return 0; } + mutex_lock (&dev->struct_mutex); + return ret; } EXPORT_SYMBOL(drm_client_lock_take); -- cgit v1.2.3