Commit d2922879 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/sec2: dump tracepc info on halt

- useful to distinguish between different issues.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent 2541626c
...@@ -47,6 +47,7 @@ void gm200_flcn_bind_inst(struct nvkm_falcon *, int, u64); ...@@ -47,6 +47,7 @@ void gm200_flcn_bind_inst(struct nvkm_falcon *, int, u64);
int gm200_flcn_bind_stat(struct nvkm_falcon *, bool); 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_imem_pio;
extern const struct nvkm_falcon_func_pio gm200_flcn_dmem_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 *); int gp102_flcn_reset_eng(struct nvkm_falcon *);
extern const struct nvkm_falcon_func_pio gp102_flcn_emem_pio; extern const struct nvkm_falcon_func_pio gp102_flcn_emem_pio;
......
...@@ -178,6 +178,11 @@ gp102_sec2_intr(struct nvkm_inth *inth) ...@@ -178,6 +178,11 @@ gp102_sec2_intr(struct nvkm_inth *inth)
} }
if (intr & 0x00000010) { if (intr & 0x00000010) {
if (atomic_read(&sec2->running)) {
FLCN_ERR(falcon, "halted");
gm200_flcn_tracepc(falcon);
}
nvkm_falcon_wr32(falcon, 0x004, 0x00000010); nvkm_falcon_wr32(falcon, 0x004, 0x00000010);
intr &= ~0x00000010; intr &= ~0x00000010;
} }
......
...@@ -25,6 +25,21 @@ ...@@ -25,6 +25,21 @@
#include <subdev/mc.h> #include <subdev/mc.h>
#include <subdev/timer.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 static void
gm200_flcn_pio_dmem_rd(struct nvkm_falcon *falcon, u8 port, const u8 *img, int len) gm200_flcn_pio_dmem_rd(struct nvkm_falcon *falcon, u8 port, const u8 *img, int len)
{ {
......
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