drm/msm/adreno: Call pm_runtime_force_suspend() during unbind
authorJordan Crouse <jcrouse@codeaurora.org>
Tue, 7 May 2019 19:18:11 +0000 (13:18 -0600)
committerRob Clark <robdclark@chromium.org>
Tue, 18 Jun 2019 20:52:49 +0000 (13:52 -0700)
The GPU specific pm_suspend code assumes that the hardware is active
when the function is called, which it usually is when called as part
of pm_runtime.  But during unbind, the pm_suspend functions are called
blindly resulting in a bit of a when the hardware wasn't already
active (or booted, in the case of the GMU).

Instead of calling the pm_suspend function directly, use
pm_runtime_force_suspend() which should check the correct state of
runtime and call the functions on our behalf or skip them if they are
not needed.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/adreno/a6xx_gmu.c
drivers/gpu/drm/msm/adreno/adreno_device.c

index 5ab69dcd547996579fb6cc46b9d172aa092e86c1..2ca470eb5cb86dbb8d68a2eb49815f8ab0585ba3 100644 (file)
@@ -1232,9 +1232,7 @@ void a6xx_gmu_remove(struct a6xx_gpu *a6xx_gpu)
        if (!gmu->initialized)
                return;
 
-       a6xx_gmu_stop(a6xx_gpu);
-
-       pm_runtime_disable(gmu->dev);
+       pm_runtime_force_suspend(gmu->dev);
 
        if (!IS_ERR_OR_NULL(gmu->gxpd)) {
                pm_runtime_disable(gmu->gxpd);
index b907245d3d96ff59a56e03f227c845d82736c1e3..3dd90dfe4d79b5f6a4941b2e769d8c3d5096d943 100644 (file)
@@ -351,7 +351,7 @@ static void adreno_unbind(struct device *dev, struct device *master,
 {
        struct msm_gpu *gpu = dev_get_drvdata(dev);
 
-       gpu->funcs->pm_suspend(gpu);
+       pm_runtime_force_suspend(dev);
        gpu->funcs->destroy(gpu);
 
        set_gpu_pdev(dev_get_drvdata(master), NULL);