drm/nouveau/gr/gk104-: prevent reading non-existent regs in intr handler
authorBen Skeggs <bskeggs@redhat.com>
Mon, 13 Apr 2015 03:09:28 +0000 (13:09 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 14 Apr 2015 07:00:55 +0000 (17:00 +1000)
Under certain circumstances the trapped address will contain subc 7,
which GK104 GR doesn't have anymore.

Notice this case to avoid causing additional priv ring faults.

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

index 3f05414c077ca3afffe106075dad10abd4fc7904..5606c25e5d02998fc415a5b9705d9a40868f2a10 100644 (file)
@@ -1097,9 +1097,14 @@ gf100_gr_intr(struct nvkm_subdev *subdev)
        u32 subc = (addr & 0x00070000) >> 16;
        u32 data = nv_rd32(priv, 0x400708);
        u32 code = nv_rd32(priv, 0x400110);
-       u32 class = nv_rd32(priv, 0x404200 + (subc * 4));
+       u32 class;
        int chid;
 
+       if (nv_device(priv)->card_type < NV_E0 || subc < 4)
+               class = nv_rd32(priv, 0x404200 + (subc * 4));
+       else
+               class = 0x0000;
+
        engctx = nvkm_engctx_get(engine, inst);
        chid   = pfifo->chid(pfifo, engctx);