Skip to content

Commit 5baf6bb

Browse files
mszyprowdaeinki
authored andcommitted
drm/exynos: Fix locking in the suspend/resume paths
Commit 48a9291 ("drm/exynos: use drm_for_each_connector_iter()") replaced unsafe drm_for_each_connector() with drm_for_each_connector_iter() and removed surrounding drm_modeset_lock calls. However, that lock was there not only to protect unsafe drm_for_each_connector(), but it was also required to be held by the dpms code which was called from the loop body. This patch restores those drm_modeset_lock calls to fix broken suspend and resume of Exynos DRM subsystem in v4.13 kernel. Fixes: 48a9291 ("drm/exynos: use drm_for_each_connector_iter()") CC: [email protected] # v4.13 Signed-off-by: Marek Szyprowski <[email protected]> Acked-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Inki Dae <[email protected]>
1 parent 134dd2e commit 5baf6bb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/gpu/drm/exynos/exynos_drm_drv.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ static int exynos_drm_suspend(struct device *dev)
174174
if (pm_runtime_suspended(dev) || !drm_dev)
175175
return 0;
176176

177+
drm_modeset_lock_all(drm_dev);
177178
drm_connector_list_iter_begin(drm_dev, &conn_iter);
178179
drm_for_each_connector_iter(connector, &conn_iter) {
179180
int old_dpms = connector->dpms;
@@ -185,6 +186,7 @@ static int exynos_drm_suspend(struct device *dev)
185186
connector->dpms = old_dpms;
186187
}
187188
drm_connector_list_iter_end(&conn_iter);
189+
drm_modeset_unlock_all(drm_dev);
188190

189191
return 0;
190192
}
@@ -198,6 +200,7 @@ static int exynos_drm_resume(struct device *dev)
198200
if (pm_runtime_suspended(dev) || !drm_dev)
199201
return 0;
200202

203+
drm_modeset_lock_all(drm_dev);
201204
drm_connector_list_iter_begin(drm_dev, &conn_iter);
202205
drm_for_each_connector_iter(connector, &conn_iter) {
203206
if (connector->funcs->dpms) {
@@ -208,6 +211,7 @@ static int exynos_drm_resume(struct device *dev)
208211
}
209212
}
210213
drm_connector_list_iter_end(&conn_iter);
214+
drm_modeset_unlock_all(drm_dev);
211215

212216
return 0;
213217
}

0 commit comments

Comments
 (0)