From 350bb74859eb6eb0d0ba7c8e6792a0b4e48849b4 Mon Sep 17 00:00:00 2001 From: Mahantesh Kumbar Date: Tue, 11 Jul 2017 11:42:01 +0530 Subject: gpu: nvgpu: PMU debug reorg - Moved PMU debug related code to pmu_debug.c Print pmu trace buffer Moved PMU controller/engine status dump debug code Moved ELPG stats dump code - Removed PMU falcon controller status dump code & used nvgpu_flcn_dump_stats() method, - Method to print ELPG stats. - PMU HAL to print PMU engine & ELPG debug info upon error NVGPU JIRA-96 Change-Id: Iaa3d983f1d3b78a1b051beb6c109d3da8f8c90bc Signed-off-by: Mahantesh Kumbar Reviewed-on: https://git-master.nvidia.com/r/1516640 Reviewed-by: svc-mobile-coverity Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu --- drivers/gpu/nvgpu/common/pmu/pmu_debug.c | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 drivers/gpu/nvgpu/common/pmu/pmu_debug.c (limited to 'drivers/gpu/nvgpu/common/pmu/pmu_debug.c') diff --git a/drivers/gpu/nvgpu/common/pmu/pmu_debug.c b/drivers/gpu/nvgpu/common/pmu/pmu_debug.c new file mode 100644 index 00000000..744a618d --- /dev/null +++ b/drivers/gpu/nvgpu/common/pmu/pmu_debug.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include +#include +#include +#include +#include +#include + +#include "gk20a/gk20a.h" + +void nvgpu_pmu_dump_elpg_stats(struct nvgpu_pmu *pmu) +{ + struct gk20a *g = pmu->g; + + /* Print PG stats */ + nvgpu_err(g, "Print PG stats"); + nvgpu_flcn_print_dmem(pmu->flcn, + pmu->stat_dmem_offset[PMU_PG_ELPG_ENGINE_ID_GRAPHICS], + sizeof(struct pmu_pg_stats_v2)); + + gk20a_pmu_dump_elpg_stats(pmu); +} + +void nvgpu_pmu_dump_falcon_stats(struct nvgpu_pmu *pmu) +{ + struct gk20a *g = pmu->g; + + nvgpu_flcn_dump_stats(pmu->flcn); + gk20a_pmu_dump_falcon_stats(pmu); + + nvgpu_err(g, "pmu state: %d", pmu->pmu_state); + nvgpu_err(g, "elpg state: %d", pmu->elpg_stat); + + /* PMU may crash due to FECS crash. Dump FECS status */ + gk20a_fecs_dump_falcon_stats(g); +} -- cgit v1.2.2