diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r-- | drivers/gpu/nvgpu/common/pmu/pmu_debug.c | 48 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/pmu/pmu_pg.c | 8 |
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 | |||
23 | void 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 | |||
36 | void 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 | } |