aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2010-08-29 06:21:16 -0400
committerBen Skeggs <bskeggs@redhat.com>2010-09-02 18:23:35 -0400
commit374c3af880ef260f36dfc968d9725494666dff31 (patch)
treeb4bc3223e3e7b5a9dfc7aac8032afd9e8350d787
parent3ba6462355c1c69dde58739a871d13bbb993e2e3 (diff)
drm/nouveau: Don't take struct_mutex around the pushbuf IOCTL.
We don't need it and it can lead to lock order inversions with respect to drm_global_mutex, potentially causing dead locks. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_gem.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
index 93711dfcafc1..10cace94395c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -245,7 +245,7 @@ validate_fini_list(struct list_head *list, struct nouveau_fence *fence)
245 list_del(&nvbo->entry); 245 list_del(&nvbo->entry);
246 nvbo->reserved_by = NULL; 246 nvbo->reserved_by = NULL;
247 ttm_bo_unreserve(&nvbo->bo); 247 ttm_bo_unreserve(&nvbo->bo);
248 drm_gem_object_unreference(nvbo->gem); 248 drm_gem_object_unreference_unlocked(nvbo->gem);
249 } 249 }
250} 250}
251 251
@@ -300,7 +300,7 @@ retry:
300 validate_fini(op, NULL); 300 validate_fini(op, NULL);
301 if (ret == -EAGAIN) 301 if (ret == -EAGAIN)
302 ret = ttm_bo_wait_unreserved(&nvbo->bo, false); 302 ret = ttm_bo_wait_unreserved(&nvbo->bo, false);
303 drm_gem_object_unreference(gem); 303 drm_gem_object_unreference_unlocked(gem);
304 if (ret) { 304 if (ret) {
305 NV_ERROR(dev, "fail reserve\n"); 305 NV_ERROR(dev, "fail reserve\n");
306 return ret; 306 return ret;
@@ -616,8 +616,6 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data,
616 return PTR_ERR(bo); 616 return PTR_ERR(bo);
617 } 617 }
618 618
619 mutex_lock(&dev->struct_mutex);
620
621 /* Mark push buffers as being used on PFIFO, the validation code 619 /* Mark push buffers as being used on PFIFO, the validation code
622 * will then make sure that if the pushbuf bo moves, that they 620 * will then make sure that if the pushbuf bo moves, that they
623 * happen on the kernel channel, which will in turn cause a sync 621 * happen on the kernel channel, which will in turn cause a sync
@@ -731,7 +729,6 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data,
731out: 729out:
732 validate_fini(&op, fence); 730 validate_fini(&op, fence);
733 nouveau_fence_unref((void**)&fence); 731 nouveau_fence_unref((void**)&fence);
734 mutex_unlock(&dev->struct_mutex);
735 kfree(bo); 732 kfree(bo);
736 kfree(push); 733 kfree(push);
737 734