Skip to content

Commit

Permalink
drm/nouveau: Take fence spinlock in nouveau_fence_channel_fini().
Browse files Browse the repository at this point in the history
Without it there's a potential race with nouveau_fence_update().

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 2b478ad commit 889fa93
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/nouveau/nouveau_fence.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,8 @@ nouveau_fence_channel_fini(struct nouveau_channel *chan)
{
struct nouveau_fence *tmp, *fence;

spin_lock(&chan->fence.lock);

list_for_each_entry_safe(fence, tmp, &chan->fence.pending, entry) {
fence->signalled = true;
list_del(&fence->entry);
Expand All @@ -499,6 +501,8 @@ nouveau_fence_channel_fini(struct nouveau_channel *chan)

kref_put(&fence->refcount, nouveau_fence_del);
}

spin_unlock(&chan->fence.lock);
}

int
Expand Down

0 comments on commit 889fa93

Please sign in to comment.