Skip to content

Commit bbe5679

Browse files
Philipp StannerDanilo Krummrich
authored andcommitted
drm/nouveau: Fix WARN_ON in nouveau_fence_context_kill()
Nouveau is mostly designed in a way that it's expected that fences only ever get signaled through nouveau_fence_signal(). However, in at least one other place, nouveau_fence_done(), can signal fences, too. If that happens (race) a signaled fence remains in the pending list for a while, until it gets removed by nouveau_fence_update(). Should nouveau_fence_context_kill() run in the meantime, this would be a bug because the function would attempt to set an error code on an already signaled fence. Have nouveau_fence_context_kill() check for a fence being signaled. Cc: [email protected] # v5.10+ Fixes: ea13e5a ("drm/nouveau: signal pending fences when channel has been killed") Suggested-by: Christian König <[email protected]> Signed-off-by: Philipp Stanner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Danilo Krummrich <[email protected]>
1 parent 095c8e6 commit bbe5679

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/nouveau/nouveau_fence.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ nouveau_fence_context_kill(struct nouveau_fence_chan *fctx, int error)
9090
while (!list_empty(&fctx->pending)) {
9191
fence = list_entry(fctx->pending.next, typeof(*fence), head);
9292

93-
if (error)
93+
if (error && !dma_fence_is_signaled_locked(&fence->base))
9494
dma_fence_set_error(&fence->base, error);
9595

9696
if (nouveau_fence_signal(fence))

0 commit comments

Comments
 (0)