drm/nouveau: drop drm_global_mutex before sleeping in submission path
authorBen Skeggs <bskeggs@redhat.com>
Thu, 26 Aug 2010 05:02:32 +0000 (15:02 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 26 Aug 2010 22:39:23 +0000 (08:39 +1000)
If we keep hold of the mutex here, the process which currently holds the
buffer object will never be able to release it, causing a deadlock.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_gem.c

index 613f878e6d0f6a2680998d9d3136b505ddbc39fc..93711dfcafc1eec2d488ca97f6e20a1594b9e952 100644 (file)
@@ -337,7 +337,9 @@ retry:
                                return -EINVAL;
                        }
 
+                       mutex_unlock(&drm_global_mutex);
                        ret = ttm_bo_wait_cpu(&nvbo->bo, false);
+                       mutex_lock(&drm_global_mutex);
                        if (ret) {
                                NV_ERROR(dev, "fail wait_cpu\n");
                                return ret;