drm/nouveau: check for dead channel before trying to idle
authorBen Skeggs <bskeggs@redhat.com>
Tue, 24 Jan 2017 06:56:52 +0000 (16:56 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 17 Feb 2017 07:38:09 +0000 (17:38 +1000)
This prevents *very* long waits while attempting to destroy channels
after a fault has occurred.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_chan.c

index 3b3d071..dbc41fa 100644 (file)
@@ -58,7 +58,7 @@ nouveau_channel_killed(struct nvif_notify *ntfy)
 int
 nouveau_channel_idle(struct nouveau_channel *chan)
 {
-       if (likely(chan && chan->fence)) {
+       if (likely(chan && chan->fence && !atomic_read(&chan->killed))) {
                struct nouveau_cli *cli = (void *)chan->user.client;
                struct nouveau_fence *fence = NULL;
                int ret;