Skip to content

Commit

Permalink
drm/nouveau: Fix sleep while atomic in nouveau_bo_fence().
Browse files Browse the repository at this point in the history
Reported-by: Pekka Paalanen <pq@iki.fi>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Francisco Jerez authored and Ben Skeggs committed Dec 3, 2010
1 parent 87a326a commit 23c45e8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/gpu/drm/nouveau/nouveau_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -942,13 +942,17 @@ nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo)
void
nouveau_bo_fence(struct nouveau_bo *nvbo, struct nouveau_fence *fence)
{
spin_lock(&nvbo->bo.bdev->fence_lock);
__nouveau_fence_unref(&nvbo->bo.sync_obj);
struct nouveau_fence *old_fence;

if (likely(fence))
nvbo->bo.sync_obj = nouveau_fence_ref(fence);
nouveau_fence_ref(fence);

spin_lock(&nvbo->bo.bdev->fence_lock);
old_fence = nvbo->bo.sync_obj;
nvbo->bo.sync_obj = fence;
spin_unlock(&nvbo->bo.bdev->fence_lock);

nouveau_fence_unref(&old_fence);
}

struct ttm_bo_driver nouveau_bo_driver = {
Expand Down

0 comments on commit 23c45e8

Please sign in to comment.