Commit 57c0bd51 authored by Akhil P Oommen's avatar Akhil P Oommen Committed by Rob Clark

drm: msm: a6xx: fix gpu failure after system resume

On targets where GMU is available, GMU takes over the ownership of GX GDSC
during its initialization. So, move the refcount-get on GX PD before we
initialize the GMU. This ensures that nobody can collapse the GX GDSC
once GMU owns the GX GDSC. This patch fixes some GMU OOB errors seen
during GPU wake up during a system resume.
Reported-by: default avatarMatthias Kaehlcke <mka@chromium.org>
Signed-off-by: default avatarAkhil P Oommen <akhilpo@codeaurora.org>
Tested-by: default avatarMatthias Kaehlcke <mka@chromium.org>
Reviewed-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
parent 32d3e0fe
...@@ -864,10 +864,19 @@ int a6xx_gmu_resume(struct a6xx_gpu *a6xx_gpu) ...@@ -864,10 +864,19 @@ int a6xx_gmu_resume(struct a6xx_gpu *a6xx_gpu)
/* Turn on the resources */ /* Turn on the resources */
pm_runtime_get_sync(gmu->dev); pm_runtime_get_sync(gmu->dev);
/*
* "enable" the GX power domain which won't actually do anything but it
* will make sure that the refcounting is correct in case we need to
* bring down the GX after a GMU failure
*/
if (!IS_ERR_OR_NULL(gmu->gxpd))
pm_runtime_get_sync(gmu->gxpd);
/* Use a known rate to bring up the GMU */ /* Use a known rate to bring up the GMU */
clk_set_rate(gmu->core_clk, 200000000); clk_set_rate(gmu->core_clk, 200000000);
ret = clk_bulk_prepare_enable(gmu->nr_clocks, gmu->clocks); ret = clk_bulk_prepare_enable(gmu->nr_clocks, gmu->clocks);
if (ret) { if (ret) {
pm_runtime_put(gmu->gxpd);
pm_runtime_put(gmu->dev); pm_runtime_put(gmu->dev);
return ret; return ret;
} }
...@@ -910,19 +919,12 @@ int a6xx_gmu_resume(struct a6xx_gpu *a6xx_gpu) ...@@ -910,19 +919,12 @@ int a6xx_gmu_resume(struct a6xx_gpu *a6xx_gpu)
/* Set the GPU to the current freq */ /* Set the GPU to the current freq */
a6xx_gmu_set_initial_freq(gpu, gmu); a6xx_gmu_set_initial_freq(gpu, gmu);
/*
* "enable" the GX power domain which won't actually do anything but it
* will make sure that the refcounting is correct in case we need to
* bring down the GX after a GMU failure
*/
if (!IS_ERR_OR_NULL(gmu->gxpd))
pm_runtime_get(gmu->gxpd);
out: out:
/* On failure, shut down the GMU to leave it in a good state */ /* On failure, shut down the GMU to leave it in a good state */
if (ret) { if (ret) {
disable_irq(gmu->gmu_irq); disable_irq(gmu->gmu_irq);
a6xx_rpmh_stop(gmu); a6xx_rpmh_stop(gmu);
pm_runtime_put(gmu->gxpd);
pm_runtime_put(gmu->dev); pm_runtime_put(gmu->dev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment