summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/pstate/pstate.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2017-03-15 08:16:07 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-03-30 15:36:26 -0400
commit8aa218e0ec54bfca3ad6d6d67a3b936c56335644 (patch)
treea7275093afd27149ec4f0d052cad9f5bd4176750 /drivers/gpu/nvgpu/pstate/pstate.c
parent6c3370a588108ba920c952d63699670905e16449 (diff)
gpu: nvgpu: check return value of mutex_init in pstate.c
- check return value of nvgpu_mutex_init in pstate.c - add new callback gk20a_deinit_pstate_support() to deinitialize pstate support - add corresponding nvgpu_mutex_destroy calls Jira NVGPU-13 Change-Id: I206bf2324e8fe95f4ed52c29ac5d8981327632b2 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1321296 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/pstate/pstate.c')
-rw-r--r--drivers/gpu/nvgpu/pstate/pstate.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/pstate/pstate.c b/drivers/gpu/nvgpu/pstate/pstate.c
index dcb8464c..41c06a8a 100644
--- a/drivers/gpu/nvgpu/pstate/pstate.c
+++ b/drivers/gpu/nvgpu/pstate/pstate.c
@@ -24,6 +24,11 @@
24 24
25static int pstate_sw_setup(struct gk20a *g); 25static int pstate_sw_setup(struct gk20a *g);
26 26
27void gk20a_deinit_pstate_support(struct gk20a *g)
28{
29 nvgpu_mutex_destroy(&g->perf_pmu.pstatesobjs.pstate_mutex);
30}
31
27/*sw setup for pstate components*/ 32/*sw setup for pstate components*/
28int gk20a_init_pstate_support(struct gk20a *g) 33int gk20a_init_pstate_support(struct gk20a *g)
29{ 34{
@@ -333,7 +338,10 @@ static int pstate_sw_setup(struct gk20a *g)
333 gk20a_dbg_fn(""); 338 gk20a_dbg_fn("");
334 339
335 init_waitqueue_head(&g->perf_pmu.pstatesobjs.pstate_notifier_wq); 340 init_waitqueue_head(&g->perf_pmu.pstatesobjs.pstate_notifier_wq);
336 nvgpu_mutex_init(&g->perf_pmu.pstatesobjs.pstate_mutex); 341
342 err = nvgpu_mutex_init(&g->perf_pmu.pstatesobjs.pstate_mutex);
343 if (err)
344 return err;
337 345
338 err = boardobjgrpconstruct_e32(&g->perf_pmu.pstatesobjs.super); 346 err = boardobjgrpconstruct_e32(&g->perf_pmu.pstatesobjs.super);
339 if (err) { 347 if (err) {
@@ -364,6 +372,8 @@ static int pstate_sw_setup(struct gk20a *g)
364 372
365 err = parse_pstate_table_5x(g, hdr); 373 err = parse_pstate_table_5x(g, hdr);
366done: 374done:
375 if (err)
376 nvgpu_mutex_destroy(&g->perf_pmu.pstatesobjs.pstate_mutex);
367 return err; 377 return err;
368} 378}
369 379