Commit 0b1bb129 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/fifo: kill channel on NV_PPBDMA_INTR_1_CTXNOTVALID

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 520db040
......@@ -164,6 +164,12 @@ gk104_runq_intr_1(struct nvkm_runq *runq)
u32 chid = nvkm_rd32(device, 0x040120 + (runq->id * 0x2000)) & 0xfff;
char msg[128];
if (stat & 0x80000000) {
if (runq->func->intr_1_ctxnotvalid &&
runq->func->intr_1_ctxnotvalid(runq, chid))
stat &= ~0x80000000;
}
if (stat) {
nvkm_snprintbf(msg, sizeof(msg), gk104_runq_intr_1_names, stat);
nvkm_error(subdev, "PBDMA%d: %08x [%s] ch %d %08x %08x\n",
......
......@@ -55,11 +55,34 @@ const struct nvkm_engn_func
gv100_engn_ce = {
};
static bool
gv100_runq_intr_1_ctxnotvalid(struct nvkm_runq *runq, int chid)
{
struct nvkm_fifo *fifo = runq->fifo;
struct nvkm_device *device = fifo->engine.subdev.device;
struct nvkm_chan *chan;
unsigned long flags;
RUNQ_ERROR(runq, "CTXNOTVALID chid:%d", chid);
chan = nvkm_chan_get_chid(&fifo->engine, chid, &flags);
if (WARN_ON_ONCE(!chan))
return false;
nvkm_chan_error(chan, true);
nvkm_chan_put(&chan, flags);
nvkm_mask(device, 0x0400ac + (runq->id * 0x2000), 0x00030000, 0x00030000);
nvkm_wr32(device, 0x040148 + (runq->id * 0x2000), 0x80000000);
return true;
}
const struct nvkm_runq_func
gv100_runq = {
.init = gk208_runq_init,
.intr = gk104_runq_intr,
.intr_0_names = gk104_runq_intr_0_names,
.intr_1_ctxnotvalid = gv100_runq_intr_1_ctxnotvalid,
};
void
......
......@@ -9,6 +9,7 @@ struct nvkm_runq {
void (*init)(struct nvkm_runq *);
bool (*intr)(struct nvkm_runq *, struct nvkm_runl *);
const struct nvkm_bitfield *intr_0_names;
bool (*intr_1_ctxnotvalid)(struct nvkm_runq *, int chid);
} *func;
struct nvkm_fifo *fifo;
int id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment