diff options
Diffstat (limited to 'drivers/gpu/nvgpu/pstate')
-rw-r--r-- | drivers/gpu/nvgpu/pstate/pstate.c | 12 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/pstate/pstate.h | 1 |
2 files changed, 12 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 | ||
25 | static int pstate_sw_setup(struct gk20a *g); | 25 | static int pstate_sw_setup(struct gk20a *g); |
26 | 26 | ||
27 | void 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*/ |
28 | int gk20a_init_pstate_support(struct gk20a *g) | 33 | int 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); |
366 | done: | 374 | done: |
375 | if (err) | ||
376 | nvgpu_mutex_destroy(&g->perf_pmu.pstatesobjs.pstate_mutex); | ||
367 | return err; | 377 | return err; |
368 | } | 378 | } |
369 | 379 | ||
diff --git a/drivers/gpu/nvgpu/pstate/pstate.h b/drivers/gpu/nvgpu/pstate/pstate.h index 22ba98b9..406f4226 100644 --- a/drivers/gpu/nvgpu/pstate/pstate.h +++ b/drivers/gpu/nvgpu/pstate/pstate.h | |||
@@ -54,6 +54,7 @@ struct pstates { | |||
54 | }; | 54 | }; |
55 | 55 | ||
56 | int gk20a_init_pstate_support(struct gk20a *g); | 56 | int gk20a_init_pstate_support(struct gk20a *g); |
57 | void gk20a_deinit_pstate_support(struct gk20a *g); | ||
57 | int gk20a_init_pstate_pmu_support(struct gk20a *g); | 58 | int gk20a_init_pstate_pmu_support(struct gk20a *g); |
58 | 59 | ||
59 | struct clk_set_info *pstate_get_clk_set_info(struct gk20a *g, u32 pstate_num, | 60 | struct clk_set_info *pstate_get_clk_set_info(struct gk20a *g, u32 pstate_num, |