drm/nouveau/sec2: dump tracepc info on halt

- useful to distinguish between different issues.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
This commit is contained in:
Ben Skeggs
2022-06-01 20:47:53 +10:00
parent 2541626cfb
commit d292287911
3 changed files with 21 additions and 0 deletions

View File

@@ -47,6 +47,7 @@ void gm200_flcn_bind_inst(struct nvkm_falcon *, int, u64);
int gm200_flcn_bind_stat(struct nvkm_falcon *, bool);
extern const struct nvkm_falcon_func_pio gm200_flcn_imem_pio;
extern const struct nvkm_falcon_func_pio gm200_flcn_dmem_pio;
void gm200_flcn_tracepc(struct nvkm_falcon *);
int gp102_flcn_reset_eng(struct nvkm_falcon *);
extern const struct nvkm_falcon_func_pio gp102_flcn_emem_pio;

View File

@@ -178,6 +178,11 @@ gp102_sec2_intr(struct nvkm_inth *inth)
}
if (intr & 0x00000010) {
if (atomic_read(&sec2->running)) {
FLCN_ERR(falcon, "halted");
gm200_flcn_tracepc(falcon);
}
nvkm_falcon_wr32(falcon, 0x004, 0x00000010);
intr &= ~0x00000010;
}

View File

@@ -25,6 +25,21 @@
#include <subdev/mc.h>
#include <subdev/timer.h>
void
gm200_flcn_tracepc(struct nvkm_falcon *falcon)
{
u32 sctl = nvkm_falcon_rd32(falcon, 0x240);
u32 tidx = nvkm_falcon_rd32(falcon, 0x148);
int nr = (tidx & 0x00ff0000) >> 16, sp, ip;
FLCN_ERR(falcon, "TRACEPC SCTL %08x TIDX %08x", sctl, tidx);
for (sp = 0; sp < nr; sp++) {
nvkm_falcon_wr32(falcon, 0x148, sp);
ip = nvkm_falcon_rd32(falcon, 0x14c);
FLCN_ERR(falcon, "TRACEPC: %08x", ip);
}
}
static void
gm200_flcn_pio_dmem_rd(struct nvkm_falcon *falcon, u8 port, const u8 *img, int len)
{