aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorYannick Fertré <yannick.fertre@st.com>2019-06-17 03:18:17 -0400
committerBenjamin Gaignard <benjamin.gaignard@linaro.org>2019-06-20 11:03:24 -0400
commit2b5d74fa3ceeaf178c74cb3f673ae452c46a7d35 (patch)
treeb4541f1b5233dae5167d8a753943d89b2ce0b37a /drivers/gpu
parent002c845be525939ee22899452fbe2b597d27b424 (diff)
drm/stm: drv: fix suspend/resume
Without this fix, the system can not go in "suspend" mode due to an error in drv_suspend function. Fixes: 35ab6cfbf211 ("drm/stm: support runtime power management") Signed-off-by: Yannick Fertré <yannick.fertre@st.com> Acked-by: Philippe Cornu <philippe.cornu@st.com> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/1560755897-5002-1-git-send-email-yannick.fertre@st.com
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/stm/drv.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
index 5659572151a8..9dee4e430de5 100644
--- a/drivers/gpu/drm/stm/drv.c
+++ b/drivers/gpu/drm/stm/drv.c
@@ -136,8 +136,7 @@ static __maybe_unused int drv_suspend(struct device *dev)
136 struct ltdc_device *ldev = ddev->dev_private; 136 struct ltdc_device *ldev = ddev->dev_private;
137 struct drm_atomic_state *state; 137 struct drm_atomic_state *state;
138 138
139 if (WARN_ON(!ldev->suspend_state)) 139 WARN_ON(ldev->suspend_state);
140 return -ENOENT;
141 140
142 state = drm_atomic_helper_suspend(ddev); 141 state = drm_atomic_helper_suspend(ddev);
143 if (IS_ERR(state)) 142 if (IS_ERR(state))
@@ -155,15 +154,17 @@ static __maybe_unused int drv_resume(struct device *dev)
155 struct ltdc_device *ldev = ddev->dev_private; 154 struct ltdc_device *ldev = ddev->dev_private;
156 int ret; 155 int ret;
157 156
157 if (WARN_ON(!ldev->suspend_state))
158 return -ENOENT;
159
158 pm_runtime_force_resume(dev); 160 pm_runtime_force_resume(dev);
159 ret = drm_atomic_helper_resume(ddev, ldev->suspend_state); 161 ret = drm_atomic_helper_resume(ddev, ldev->suspend_state);
160 if (ret) { 162 if (ret)
161 pm_runtime_force_suspend(dev); 163 pm_runtime_force_suspend(dev);
162 ldev->suspend_state = NULL;
163 return ret;
164 }
165 164
166 return 0; 165 ldev->suspend_state = NULL;
166
167 return ret;
167} 168}
168 169
169static __maybe_unused int drv_runtime_suspend(struct device *dev) 170static __maybe_unused int drv_runtime_suspend(struct device *dev)