Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91c772ec authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/gr/gk104-: prevent reading non-existent regs in intr handler



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: default avatarBen Skeggs <bskeggs@redhat.com>
parent ddec1a2b
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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);