summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common
diff options
context:
space:
mode:
authorMahantesh Kumbar <mkumbar@nvidia.com>2017-07-11 02:12:01 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-09-25 03:18:59 -0400
commit350bb74859eb6eb0d0ba7c8e6792a0b4e48849b4 (patch)
tree3756bbd4d958930a4d999f95b8ef90694e3cf3c1 /drivers/gpu/nvgpu/common
parentb5556c74905974b0b19defb775f7301a341982a0 (diff)
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 <mkumbar@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1516640 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r--drivers/gpu/nvgpu/common/pmu/pmu_debug.c48
-rw-r--r--drivers/gpu/nvgpu/common/pmu/pmu_pg.c8
2 files changed, 52 insertions, 4 deletions
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 @@
1/*
2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 */
13
14#include <nvgpu/pmu.h>
15#include <nvgpu/log.h>
16#include <nvgpu/timers.h>
17#include <nvgpu/kmem.h>
18#include <nvgpu/dma.h>
19#include <nvgpu/pmuif/nvgpu_gpmu_cmdif.h>
20
21#include "gk20a/gk20a.h"
22
23void nvgpu_pmu_dump_elpg_stats(struct nvgpu_pmu *pmu)
24{
25 struct gk20a *g = pmu->g;
26
27 /* Print PG stats */
28 nvgpu_err(g, "Print PG stats");
29 nvgpu_flcn_print_dmem(pmu->flcn,
30 pmu->stat_dmem_offset[PMU_PG_ELPG_ENGINE_ID_GRAPHICS],
31 sizeof(struct pmu_pg_stats_v2));
32
33 gk20a_pmu_dump_elpg_stats(pmu);
34}
35
36void nvgpu_pmu_dump_falcon_stats(struct nvgpu_pmu *pmu)
37{
38 struct gk20a *g = pmu->g;
39
40 nvgpu_flcn_dump_stats(pmu->flcn);
41 gk20a_pmu_dump_falcon_stats(pmu);
42
43 nvgpu_err(g, "pmu state: %d", pmu->pmu_state);
44 nvgpu_err(g, "elpg state: %d", pmu->elpg_stat);
45
46 /* PMU may crash due to FECS crash. Dump FECS status */
47 gk20a_fecs_dump_falcon_stats(g);
48}
diff --git a/drivers/gpu/nvgpu/common/pmu/pmu_pg.c b/drivers/gpu/nvgpu/common/pmu/pmu_pg.c
index b435f4a7..3f74b9f7 100644
--- a/drivers/gpu/nvgpu/common/pmu/pmu_pg.c
+++ b/drivers/gpu/nvgpu/common/pmu/pmu_pg.c
@@ -265,8 +265,8 @@ int nvgpu_pmu_disable_elpg(struct gk20a *g)
265 if (pmu->elpg_stat != PMU_ELPG_STAT_ON) { 265 if (pmu->elpg_stat != PMU_ELPG_STAT_ON) {
266 nvgpu_err(g, "ELPG_ALLOW_ACK failed, elpg_stat=%d", 266 nvgpu_err(g, "ELPG_ALLOW_ACK failed, elpg_stat=%d",
267 pmu->elpg_stat); 267 pmu->elpg_stat);
268 pmu_dump_elpg_stats(pmu); 268 nvgpu_pmu_dump_elpg_stats(pmu);
269 pmu_dump_falcon_stats(pmu); 269 nvgpu_pmu_dump_falcon_stats(pmu);
270 ret = -EBUSY; 270 ret = -EBUSY;
271 goto exit_unlock; 271 goto exit_unlock;
272 } 272 }
@@ -315,8 +315,8 @@ int nvgpu_pmu_disable_elpg(struct gk20a *g)
315 ptr, PMU_ELPG_STAT_OFF); 315 ptr, PMU_ELPG_STAT_OFF);
316 if (*ptr != PMU_ELPG_STAT_OFF) { 316 if (*ptr != PMU_ELPG_STAT_OFF) {
317 nvgpu_err(g, "ELPG_DISALLOW_ACK failed"); 317 nvgpu_err(g, "ELPG_DISALLOW_ACK failed");
318 pmu_dump_elpg_stats(pmu); 318 nvgpu_pmu_dump_elpg_stats(pmu);
319 pmu_dump_falcon_stats(pmu); 319 nvgpu_pmu_dump_falcon_stats(pmu);
320 ret = -EBUSY; 320 ret = -EBUSY;
321 goto exit_unlock; 321 goto exit_unlock;
322 } 322 }