Skip to contentSkip to conversation

drm/exynos/decon: fix disable clocks order

PATCH In review Andrzej Hajda 2 participants 2 messages Feb 11, 2016 – Feb 12, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/exynos/decon: fix disable clocks order

Decon requires that clocks should be disabled in reverse order. Otherwise system hangs.

---
 drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos5433_drm_decon.c +2 -2
index 1bf6a21..98615e2 100644
@@ -582,9 +582,9 @@ out:
 static int exynos5433_decon_suspend(struct device *dev)
 {
 	struct decon_context *ctx = dev_get_drvdata(dev);
-	int i;
+	int i = ARRAY_SIZE(decon_clks_name);
 
-	for (i = 0; i < ARRAY_SIZE(decon_clks_name); i++)
+	while (--i >= 0)
 		clk_disable_unprepare(ctx->clks[i]);
 
 	return 0;
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer
#1 lore raw

Picked it up.

Thanks,
Inki Dae

2016년 02월 11일 20:25에 Andrzej Hajda 이(가) 쓴 글:

Quoted 25 lines

Decon requires that clocks should be disabled in reverse order. Otherwise system hangs.

---
 drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos5433_drm_decon.c +2 -2
index 1bf6a21..98615e2 100644
@@ -582,9 +582,9 @@ out:
 static int exynos5433_decon_suspend(struct device *dev)
 {
 	struct decon_context *ctx = dev_get_drvdata(dev);
-	int i;
+	int i = ARRAY_SIZE(decon_clks_name);
 
-	for (i = 0; i < ARRAY_SIZE(decon_clks_name); i++)
+	while (--i >= 0)
 		clk_disable_unprepare(ctx->clks[i]);
 
 	return 0;