struct nouveau_cli *cli = (void *)chan->user.client;
        NV_PRINTK(warn, cli, "channel %d killed!\n", chan->chid);
        atomic_set(&chan->killed, 1);
+       if (chan->fence)
+               nouveau_fence_context_kill(chan->fence, -ENODEV);
        return NVIF_NOTIFY_DROP;
 }
 
 
 }
 
 void
-nouveau_fence_context_del(struct nouveau_fence_chan *fctx)
+nouveau_fence_context_kill(struct nouveau_fence_chan *fctx, int error)
 {
        struct nouveau_fence *fence;
 
        while (!list_empty(&fctx->pending)) {
                fence = list_entry(fctx->pending.next, typeof(*fence), head);
 
+               if (error)
+                       dma_fence_set_error(&fence->base, error);
+
                if (nouveau_fence_signal(fence))
                        nvif_notify_put(&fctx->notify);
        }
        spin_unlock_irq(&fctx->lock);
+}
 
+void
+nouveau_fence_context_del(struct nouveau_fence_chan *fctx)
+{
+       nouveau_fence_context_kill(fctx, 0);
        nvif_notify_fini(&fctx->notify);
        fctx->dead = 1;
 
 
 void nouveau_fence_context_new(struct nouveau_channel *, struct nouveau_fence_chan *);
 void nouveau_fence_context_del(struct nouveau_fence_chan *);
 void nouveau_fence_context_free(struct nouveau_fence_chan *);
+void nouveau_fence_context_kill(struct nouveau_fence_chan *, int error);
 
 int nv04_fence_create(struct nouveau_drm *);
 int nv04_fence_mthd(struct nouveau_channel *, u32, u32, u32);