提交 937c3471 编写于 作者: F Francisco Jerez

drm/nouveau: Avoid potential race between nouveau_fence_update() and context takedown.

Signed-off-by: NFrancisco Jerez <currojerez@riseup.net>
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 a8b214f0
...@@ -77,14 +77,17 @@ nouveau_fence_update(struct nouveau_channel *chan) ...@@ -77,14 +77,17 @@ nouveau_fence_update(struct nouveau_channel *chan)
spin_lock(&chan->fence.lock); spin_lock(&chan->fence.lock);
if (USE_REFCNT(dev)) /* Fetch the last sequence if the channel is still up and running */
sequence = nvchan_rd32(chan, 0x48); if (likely(!list_empty(&chan->fence.pending))) {
else if (USE_REFCNT(dev))
sequence = atomic_read(&chan->fence.last_sequence_irq); sequence = nvchan_rd32(chan, 0x48);
else
if (chan->fence.sequence_ack == sequence) sequence = atomic_read(&chan->fence.last_sequence_irq);
goto out;
chan->fence.sequence_ack = sequence; if (chan->fence.sequence_ack == sequence)
goto out;
chan->fence.sequence_ack = sequence;
}
list_for_each_entry_safe(fence, tmp, &chan->fence.pending, entry) { list_for_each_entry_safe(fence, tmp, &chan->fence.pending, entry) {
sequence = fence->sequence; sequence = fence->sequence;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册