summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/pmu/pmu_pg.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/pmu/pmu_pg.c')
-rw-r--r--drivers/gpu/nvgpu/common/pmu/pmu_pg.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/pmu/pmu_pg.c b/drivers/gpu/nvgpu/common/pmu/pmu_pg.c
index 3d46298d..941cee75 100644
--- a/drivers/gpu/nvgpu/common/pmu/pmu_pg.c
+++ b/drivers/gpu/nvgpu/common/pmu/pmu_pg.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"), 5 * copy of this software and associated documentation files (the "Software"),
@@ -359,6 +359,36 @@ exit_unlock:
359 return ret; 359 return ret;
360} 360}
361 361
362int nvgpu_pmu_reenable_elpg(struct gk20a *g)
363{
364 struct nvgpu_pmu *pmu = &g->pmu;
365 int ret = 0;
366
367 nvgpu_log_fn(g, " ");
368
369 if (!g->support_pmu) {
370 return ret;
371 }
372
373 /* If pmu enabled, re-enable by first disabling, then
374 * enabling
375 */
376 if (pmu->elpg_refcnt != 0) {
377 ret = nvgpu_pmu_disable_elpg(g);
378 if (ret != 0) {
379 nvgpu_err(g, "failed disabling elpg");
380 goto exit;
381 }
382 ret = nvgpu_pmu_enable_elpg(g);
383 if (ret != 0) {
384 nvgpu_err(g, "failed enabling elpg");
385 goto exit;
386 }
387 }
388exit:
389 return ret;
390}
391
362/* PG init */ 392/* PG init */
363static void pmu_handle_pg_stat_msg(struct gk20a *g, struct pmu_msg *msg, 393static void pmu_handle_pg_stat_msg(struct gk20a *g, struct pmu_msg *msg,
364 void *param, u32 handle, u32 status) 394 void *param, u32 handle, u32 status)