diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/pstate/pstate.c | 12 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/pstate/pstate.h | 1 |
3 files changed, 16 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index aae3072a..060429d1 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -459,6 +459,10 @@ static int gk20a_pm_prepare_poweroff(struct device *dev) | |||
459 | if (g->ops.clk.suspend_clk_support) | 459 | if (g->ops.clk.suspend_clk_support) |
460 | ret |= g->ops.clk.suspend_clk_support(g); | 460 | ret |= g->ops.clk.suspend_clk_support(g); |
461 | 461 | ||
462 | #ifdef CONFIG_ARCH_TEGRA_18x_SOC | ||
463 | if (g->ops.pmupstate) | ||
464 | gk20a_deinit_pstate_support(g); | ||
465 | #endif | ||
462 | g->power_on = false; | 466 | g->power_on = false; |
463 | 467 | ||
464 | /* Decrement platform power refcount */ | 468 | /* Decrement platform power refcount */ |
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, |