summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Huang <kenbshuang@google.com>2023-06-21 22:19:43 +0800
committerTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2023-08-28 16:18:23 +0000
commit437eb3738e93b50af6eff9f7cf4044751ad9e402 (patch)
treeadb819b50d67d9eb78b7af00e21aa4716359a0ba
parent05ed1ccc4609ce529b0517a63dbb7f6333423eca (diff)
downloaddisplay-437eb3738e93b50af6eff9f7cf4044751ad9e402.tar.gz
There is a race condition during decon suspend if decon state has been updated earlier than decon suspend while crtc is still enabled. In that case, it makes pm suspend misunderstand dpu had suspended. Bug: 282372962 Test: unplug usb to test AoD and suspend/resume Change-Id: I133d14c049ad9c11cb02818d479513fe18b83aca Signed-off-by: Ken Huang <kenbshuang@google.com> (cherry picked from commit 9f1c59dd946fff4e1c7357fa81303065efb1987e)
-rw-r--r--samsung/exynos_drm_decon.c11
-rw-r--r--samsung/exynos_drm_hibernation.c3
2 files changed, 9 insertions, 5 deletions
diff --git a/samsung/exynos_drm_decon.c b/samsung/exynos_drm_decon.c
index bc46cb4..706e096 100644
--- a/samsung/exynos_drm_decon.c
+++ b/samsung/exynos_drm_decon.c
@@ -2324,14 +2324,17 @@ static int decon_suspend(struct device *dev)
struct decon_device *decon = dev_get_drvdata(dev);
int ret;
- if (!decon_is_effectively_active(decon))
- return 0;
-
decon_debug(decon, "%s\n", __func__);
+ if (!decon->hibernation)
+ return 0;
+
ret = exynos_hibernation_suspend(decon->hibernation);
- DPU_EVENT_LOG(DPU_EVT_DECON_SUSPEND, decon->id, NULL);
+ if (ret == -ENOTCONN)
+ ret = 0;
+ else
+ DPU_EVENT_LOG(DPU_EVT_DECON_SUSPEND, decon->id, NULL);
return ret;
}
diff --git a/samsung/exynos_drm_hibernation.c b/samsung/exynos_drm_hibernation.c
index 525c76e..eb6744e 100644
--- a/samsung/exynos_drm_hibernation.c
+++ b/samsung/exynos_drm_hibernation.c
@@ -123,6 +123,7 @@ retry:
if (!crtc_state->enable) {
pr_debug("%s: skipping due to crtc disabled\n", __func__);
+ ret = -ENOTCONN;
goto out;
}
@@ -386,7 +387,7 @@ int exynos_hibernation_suspend(struct exynos_hibernation *hiber)
if (atomic_read(&hiber->block_cnt) > 0)
ret = -EBUSY;
- else if (hiber->decon->state == DECON_STATE_ON)
+ else
ret = _exynos_hibernation_run(hiber, false);
DPU_ATRACE_END(__func__);