diff options
Diffstat (limited to 'drivers/gpu/nvgpu/pstate/pstate.c')
-rw-r--r-- | drivers/gpu/nvgpu/pstate/pstate.c | 12 |
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 | ||
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 | ||