From eab87c7afeb6ce55edcfeae568e6c3c4c0bd9f31 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Fri, 3 Oct 2014 10:45:23 +0300 Subject: gpu: nvgpu: dump falcon stats in mmu fault handler If engine status is in context switch in the fifo mmu fault handler, dump falcon stats and gr stats for each engine. Bug 1544766 Change-Id: Idfa9772b7e67072941144ac3bdd73e791fdc2b23 Signed-off-by: Konsta Holtta Reviewed-on: http://git-master/r/553205 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index 05377c3d..a9aea632 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c @@ -966,6 +966,7 @@ static bool gk20a_fifo_handle_mmu_fault(struct gk20a *g) unsigned long engine_mmu_id; bool verbose = true; u32 grfifo_ctl; + gk20a_dbg_fn(""); g->fifo.deferred_reset_pending = false; @@ -1002,6 +1003,15 @@ static bool gk20a_fifo_handle_mmu_fault(struct gk20a *g) struct fifo_mmu_fault_info_gk20a f; struct channel_gk20a *ch = NULL; struct tsg_gk20a *tsg = NULL; + /* read and parse engine status */ + u32 status = gk20a_readl(g, fifo_engine_status_r(engine_id)); + u32 ctx_status = fifo_engine_status_ctx_status_v(status); + bool ctxsw = (ctx_status == + fifo_engine_status_ctx_status_ctxsw_switch_v() + || ctx_status == + fifo_engine_status_ctx_status_ctxsw_save_v() + || ctx_status == + fifo_engine_status_ctx_status_ctxsw_load_v()); get_exception_mmu_fault_info(g, engine_mmu_id, &f); trace_gk20a_mmu_fault(f.fault_hi_v, @@ -1023,14 +1033,14 @@ static bool gk20a_fifo_handle_mmu_fault(struct gk20a *g) f.fault_type_v, f.fault_type_desc, f.fault_info_v, f.inst_ptr); + if (ctxsw) { + gk20a_fecs_dump_falcon_stats(g); + gk20a_err(dev_from_gk20a(g), "gr_status_r : 0x%x", + gk20a_readl(g, gr_status_r())); + } + /* get the channel/TSG */ if (fake_fault) { - /* read and parse engine status */ - u32 status = gk20a_readl(g, - fifo_engine_status_r(engine_id)); - u32 ctx_status = - fifo_engine_status_ctx_status_v(status); - /* use next_id if context load is failing */ u32 id = (ctx_status == fifo_engine_status_ctx_status_ctxsw_load_v()) ? -- cgit v1.2.2