diff options
author | Francisco Jerez <currojerez@riseup.net> | 2010-10-28 17:10:29 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-12-03 00:11:23 -0500 |
commit | 23c45e8ed203f933753fb66a6290c4ff853eb7bb (patch) | |
tree | 53429af266610a450b4ce71c739ddc7bb816fc9b /drivers/gpu/drm/nouveau/nouveau_bo.c | |
parent | 87a326a38589e1c919af5f86a59cd571ff0aa831 (diff) |
drm/nouveau: Fix sleep while atomic in nouveau_bo_fence().
Reported-by: Pekka Paalanen <pq@iki.fi>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bo.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bo.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 8d5dd980240d..f4ee43db00aa 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c | |||
@@ -942,13 +942,17 @@ nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo) | |||
942 | void | 942 | void |
943 | nouveau_bo_fence(struct nouveau_bo *nvbo, struct nouveau_fence *fence) | 943 | nouveau_bo_fence(struct nouveau_bo *nvbo, struct nouveau_fence *fence) |
944 | { | 944 | { |
945 | spin_lock(&nvbo->bo.bdev->fence_lock); | 945 | struct nouveau_fence *old_fence; |
946 | __nouveau_fence_unref(&nvbo->bo.sync_obj); | ||
947 | 946 | ||
948 | if (likely(fence)) | 947 | if (likely(fence)) |
949 | nvbo->bo.sync_obj = nouveau_fence_ref(fence); | 948 | nouveau_fence_ref(fence); |
950 | 949 | ||
950 | spin_lock(&nvbo->bo.bdev->fence_lock); | ||
951 | old_fence = nvbo->bo.sync_obj; | ||
952 | nvbo->bo.sync_obj = fence; | ||
951 | spin_unlock(&nvbo->bo.bdev->fence_lock); | 953 | spin_unlock(&nvbo->bo.bdev->fence_lock); |
954 | |||
955 | nouveau_fence_unref(&old_fence); | ||
952 | } | 956 | } |
953 | 957 | ||
954 | struct ttm_bo_driver nouveau_bo_driver = { | 958 | struct ttm_bo_driver nouveau_bo_driver = { |