Skip to contentSkip to conversation

drm/nv84+: fix fence context seqno's

PATCH In review Maarten Lankhorst 4 participants 5 messages Sep 22, 2014 – Sep 25, 2014 4 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nv84+: fix fence context seqno's

This fixes a regression introduced by "drm/nouveau: rework to new fence interface" (commit 29ba89b2371d466).

The fence sequence should not be reset after creation, the old value is used instead. On destruction the final value is written, to prevent another source of accidental wraparound in case of a channel being destroyed after a hang, and unblocking any other channel that may wait on the about-to-be-deleted channel to signal.

I'm nothing if not optimistic about any hope of recovery from that. ;-)

---

drivers/gpu/drm/nouveau/nv84_fence.c +1 -2
index 7b372a68aa4e..4138db4d8291 100644
@@ -120,6 +120,7 @@ nv84_fence_context_del(struct nouveau_channel *chan)
 		nouveau_bo_vma_del(bo, &fctx->dispc_vma[i]);
 	}
 
+	nouveau_bo_wr32(priv->bo, chan->chid * 16 / 4, fctx->base.sequence);
 	nouveau_bo_vma_del(priv->bo, &fctx->vma_gart);
 	nouveau_bo_vma_del(priv->bo, &fctx->vma);
 	nouveau_fence_context_del(&fctx->base);
@@ -159,8 +160,6 @@ nv84_fence_context_new(struct nouveau_channel *chan)
 		ret = nouveau_bo_vma_add(bo, cli->vm, &fctx->dispc_vma[i]);
 	}
 
-	nouveau_bo_wr32(priv->bo, chan->chid * 16/4, 0x00000000);
-
 	if (ret)
 		nv84_fence_context_del(chan);
 	return ret;
Tested-by
#2 lore raw
In reply to a message not in the archive
Quoted 27 lines · Maarten Lankhorst

This fixes a regression introduced by "drm/nouveau: rework to new fence interface" (commit 29ba89b2371d466).

The fence sequence should not be reset after creation, the old value is used instead. On destruction the final value is written, to prevent another source of accidental wraparound in case of a channel being destroyed after a hang, and unblocking any other channel that may wait on the about-to-be-deleted channel to signal.

I'm nothing if not optimistic about any hope of recovery from that. ;-)

---

drivers/gpu/drm/nouveau/nv84_fence.c +1 -0
index 7b372a68aa4e..4138db4d8291 100644
@@ -120,6 +120,7 @@ nv84_fence_context_del(struct nouveau_channel *chan)
 		nouveau_bo_vma_del(bo, &fctx->dispc_vma[i]);
 	}
 
+	nouveau_bo_wr32(priv->bo, chan->chid * 16 / 4, fctx->base.sequence);
 	nouveau_bo_vma_del(priv->bo, &fctx->vma_gart);
 	nouveau_bo_vma_del(priv->bo, &fctx->vma);
 	nouveau_fence_context_del(&fctx->base);

drivers/gpu/drm/nouveau/nv84_fence.c nv84_fence_context_new(struct nouveau_channel *chan) · line 165

Quoted 8 lines
drivers/gpu/drm/nouveau/nv84_fence.c +0 -2
@@ -159,8 +160,6 @@ nv84_fence_context_new(struct nouveau_channel *chan)
 		ret = nouveau_bo_vma_add(bo, cli->vm, &fctx->dispc_vma[i]);
 	}
 
-	nouveau_bo_wr32(priv->bo, chan->chid * 16/4, 0x00000000);
-
 	if (ret)
 		nv84_fence_context_del(chan);
 	return ret;

This works, thanks :-)

Acked-by
#4 lore raw
In reply to a message not in the archive
Quoted 9 lines · Ted Percival
Quoted 8 lines · Maarten Lankhorst

This fixes a regression introduced by "drm/nouveau: rework to new fence interface" (commit 29ba89b2371d466).

The fence sequence should not be reset after creation, the old value is used instead. On destruction the final value is written, to prevent another source of accidental wraparound in case of a channel being destroyed after a hang, and unblocking any other channel that may wait on the about-to-be-deleted channel to signal.

Quoted 4 lines
Quoted 4 lines

I'm nothing if not optimistic about any hope of recovery from that. ;-)

I'm still seeing issues with suspend, even with this patch, and the one you pastebinned recently.

Quoted 31 lines
Quoted 15 lines

---

drivers/gpu/drm/nouveau/nv84_fence.c +1 -0
index 7b372a68aa4e..4138db4d8291 100644
@@ -120,6 +120,7 @@ nv84_fence_context_del(struct nouveau_channel *chan)
              nouveau_bo_vma_del(bo, &fctx->dispc_vma[i]);
      }
 
+     nouveau_bo_wr32(priv->bo, chan->chid * 16 / 4, fctx->base.sequence);
      nouveau_bo_vma_del(priv->bo, &fctx->vma_gart);
      nouveau_bo_vma_del(priv->bo, &fctx->vma);
      nouveau_fence_context_del(&fctx->base);

drivers/gpu/drm/nouveau/nv84_fence.c nv84_fence_context_new(struct nouveau_channel *chan) · line 165

Quoted 8 lines
drivers/gpu/drm/nouveau/nv84_fence.c +0 -2
@@ -159,8 +160,6 @@ nv84_fence_context_new(struct nouveau_channel *chan)
              ret = nouveau_bo_vma_add(bo, cli->vm, &fctx->dispc_vma[i]);
      }
 
-     nouveau_bo_wr32(priv->bo, chan->chid * 16/4, 0x00000000);
-
      if (ret)
              nv84_fence_context_del(chan);
      return ret;

This works, thanks :-)

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#6 lore raw
In reply to a message not in the archive

Op 23-09-14 om 07:35 schreef Ben Skeggs:

Quoted 10 lines · Ted Percival
Quoted 9 lines · Maarten Lankhorst
Quoted 8 lines

This fixes a regression introduced by "drm/nouveau: rework to new fence interface" (commit 29ba89b2371d466).

The fence sequence should not be reset after creation, the old value is used instead. On destruction the final value is written, to prevent another source of accidental wraparound in case of a channel being destroyed after a hang, and unblocking any other channel that may wait on the about-to-be-deleted channel to signal.

Quoted 9 lines
Quoted 4 lines
Quoted 4 lines

I'm nothing if not optimistic about any hope of recovery from that. ;-)

I'm still seeing issues with suspend, even with this patch, and the one you pastebinned recently.

Annoying, and I'm out of ideas. The pastebinned patch is posted to dri-devel as:
[PATCH 2/8] drm/nouveau: specify if interruptible wait is desired in nouveau_fence_sync.

Could you bisect to where the suspend issues started? With this patch applied after "drm/nouveau: rework to new fence interface", and the other patch applied after "drm/nouveau: use shared fences for readable objects"

~Maarten

#8 lore raw
In reply to a message not in the archive
Quoted 8 lines · Maarten Lankhorst

Op 23-09-14 om 07:35 schreef Ben Skeggs:

Quoted 7 lines
Quoted 3 lines · Maarten Lankhorst
Quoted 2 lines

This fixes a regression introduced by "drm/nouveau: rework to new fence interface" (commit 29ba89b2371d466).

I'm still seeing issues with suspend, even with this patch, and the one you pastebinned recently.

Quoted 6 lines

Annoying, and I'm out of ideas. The pastebinned patch is posted to dri-devel as:
[PATCH 2/8] drm/nouveau: specify if interruptible wait is desired in nouveau_fence_sync.

Could you bisect to where the suspend issues started? With this patch applied after "drm/nouveau: rework to new fence interface", and the other patch applied after "drm/nouveau: use shared fences for readable objects"

I started bisecting to track down the suspend issue, but X won't start at all with today's dri-next tree @ d743ecf36063 ("drm/doc: Fixup drm_irq kerneldoc includes") plus the two patches, so I'll have to get that out of the way first.