gpu: nvgpu: Defer pstate deinit to driver remove

The PMU pstate deinit was invoked part of gpu power off. This frees and clears
the pmgr_pmu struct which causes the pmu remove support to crash when it
tries to access the pmgr_pmu object for freeing up the pmu board objects.
Deferred pstate deinit to nvgpu driver removal as there is no reason for it be
invoked part of prepare poweroff sequence.

JIRA NVGPU-1618

Change-Id: I2eb52000f0732d0abed54946e0843367b119d443
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1971225
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Antony Clince Alex
2018-12-12 15:22:40 +05:30
committed by mobile promotions
parent d62281a15a
commit 7fb33cf87b
2 changed files with 4 additions and 5 deletions

View File

@@ -107,11 +107,6 @@ int gk20a_prepare_poweroff(struct gk20a *g)
if (g->ops.clk.suspend_clk_support != NULL) { if (g->ops.clk.suspend_clk_support != NULL) {
ret |= g->ops.clk.suspend_clk_support(g); ret |= g->ops.clk.suspend_clk_support(g);
} }
if (nvgpu_is_enabled(g, NVGPU_PMU_PSTATE)) {
gk20a_deinit_pstate_support(g);
}
gk20a_mask_interrupts(g); gk20a_mask_interrupts(g);
g->power_on = false; g->power_on = false;

View File

@@ -733,6 +733,10 @@ void gk20a_remove_support(struct gk20a *g)
if (g->pmu.remove_support) if (g->pmu.remove_support)
g->pmu.remove_support(&g->pmu); g->pmu.remove_support(&g->pmu);
if (nvgpu_is_enabled(g, NVGPU_PMU_PSTATE)) {
gk20a_deinit_pstate_support(g);
}
if (g->sec2.remove_support != NULL) { if (g->sec2.remove_support != NULL) {
g->sec2.remove_support(&g->sec2); g->sec2.remove_support(&g->sec2);
} }