]> git.baikalelectronics.ru Git - kernel.git/commit
drm/msm/gpu: Wait for idle before suspending
authorRob Clark <robdclark@chromium.org>
Sat, 8 Jan 2022 18:09:10 +0000 (10:09 -0800)
committerRob Clark <robdclark@chromium.org>
Tue, 25 Jan 2022 16:54:41 +0000 (08:54 -0800)
commitacaa01c04470df169a9540b8d932aa8221b2599a
treeddb4f75189dd645cbe5983ecddc3a3d771faafc2
parentca302e050726137042ad5a7ed42d2b283aa854ed
drm/msm/gpu: Wait for idle before suspending

System suspend uses pm_runtime_force_suspend(), which cheekily bypasses
the runpm reference counts.  This doesn't actually work so well when the
GPU is active.  So add a reasonable delay waiting for the GPU to become
idle.

Alternatively we could just return -EBUSY in this case, but that has the
disadvantage of causing system suspend to fail.

v2: s/ret/remaining [sboyd], and switch to using active_submits count
    to ensure we aren't racing with submit cleanup (and devfreq idle
    work getting scheduled, etc)
v3: fix inverted logic

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220108180913.814448-2-robdclark@gmail.com
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/adreno/adreno_device.c
drivers/gpu/drm/msm/msm_gpu.c
drivers/gpu/drm/msm/msm_gpu.h