drm/exynos: fix runtime_pm fimd device state on probe
Marek Szyprowski [Thu, 8 Mar 2012 01:28:56 +0000 (10:28 +0900)]
A call to pm_runtime_set_active() forces device to be at the active
state and skips calling its runtime suspend/resume callbacks. This
results in a freeze with a new power domain code based on gen_pd. Fimd
driver does all required runtime power management calls, so this
pm_runtime_set_active call is buggy. This patch removes it and corrects
clock management in probe function (clocks are now enabled by
pm_runtime_get_sync() call).

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

drivers/gpu/drm/exynos/exynos_drm_fimd.c

index 360adf2..56458ee 100644 (file)
@@ -817,8 +817,6 @@ static int __devinit fimd_probe(struct platform_device *pdev)
                goto err_clk_get;
        }
 
-       clk_enable(ctx->bus_clk);
-
        ctx->lcd_clk = clk_get(dev, "sclk_fimd");
        if (IS_ERR(ctx->lcd_clk)) {
                dev_err(dev, "failed to get lcd clock\n");
@@ -826,8 +824,6 @@ static int __devinit fimd_probe(struct platform_device *pdev)
                goto err_bus_clk;
        }
 
-       clk_enable(ctx->lcd_clk);
-
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!res) {
                dev_err(dev, "failed to find registers\n");
@@ -864,17 +860,11 @@ static int __devinit fimd_probe(struct platform_device *pdev)
                goto err_req_irq;
        }
 
-       ctx->clkdiv = fimd_calc_clkdiv(ctx, &panel->timing);
        ctx->vidcon0 = pdata->vidcon0;
        ctx->vidcon1 = pdata->vidcon1;
        ctx->default_win = pdata->default_win;
        ctx->panel = panel;
 
-       panel->timing.pixclock = clk_get_rate(ctx->lcd_clk) / ctx->clkdiv;
-
-       DRM_DEBUG_KMS("pixel clock = %d, clkdiv = %d\n",
-                       panel->timing.pixclock, ctx->clkdiv);
-
        subdrv = &ctx->subdrv;
 
        subdrv->probe = fimd_subdrv_probe;
@@ -889,10 +879,15 @@ static int __devinit fimd_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, ctx);
 
-       pm_runtime_set_active(dev);
        pm_runtime_enable(dev);
        pm_runtime_get_sync(dev);
 
+       ctx->clkdiv = fimd_calc_clkdiv(ctx, &panel->timing);
+       panel->timing.pixclock = clk_get_rate(ctx->lcd_clk) / ctx->clkdiv;
+
+       DRM_DEBUG_KMS("pixel clock = %d, clkdiv = %d\n",
+                       panel->timing.pixclock, ctx->clkdiv);
+
        for (win = 0; win < WINDOWS_NR; win++)
                fimd_clear_win(ctx, win);