<div dir="ltr">Hi Inki Dae and Viresh,<br><div class="gmail_extra"><br><div class="gmail_quote">On 8 April 2013 16:41, Viresh Kumar <span dir="ltr"><<a href="mailto:viresh.kumar@linaro.org" target="_blank">viresh.kumar@linaro.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>On 8 April 2013 16:37, Vikas Sajjan <<a href="mailto:vikas.sajjan@linaro.org" target="_blank">vikas.sajjan@linaro.org</a>> wrote:<br>
> While migrating to common clock framework (CCF), I found that the FIMD clocks<br>
> were pulled down by the CCF.<br>
> If CCF finds any clock(s) which has NOT been claimed by any of the<br>
> drivers, then such clock(s) are PULLed low by CCF.<br>
><br>
> Calling clk_prepare() for FIMD clocks fixes the issue.<br>
><br>
> This patch also replaces clk_disable() with clk_unprepare() during exit, since<br>
> clk_prepare() is called in fimd_probe().<br>
<br>
</div>I asked you about fixing your commit log too.. It still looks incorrect to me.<br>
<br>
This patch doesn't have anything to do with CCF pulling clocks down, but<br>
calling clk_prepare() before clk_enable() is must now.. that's it..<br>
nothing more.<br>
<div><div><br></div></div></blockquote><div> what I noticed is the fimd_clock() which in turn calls clk_enable(), will only be called if the RUNTIME PM is enabled. So the current patch breaks and display won't appear, if we don't enable the RUNTIME PM. So it becomes mandatory to enable RUNTIME PM, to FIMD to work.<br>
I am NOT sure whether it is a good idea make FIMD work if and only if RUMTIME PM is enabled.<br>I guess Mr. Inki Dae can throw more light on this.<br>Or else make it like the earlier V1 version where clk_prepare_enable() was called in fimd_probe() itself.<br>
<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>
> Signed-off-by: Vikas Sajjan <<a href="mailto:vikas.sajjan@linaro.org" target="_blank">vikas.sajjan@linaro.org</a>><br>
> ---<br>
> Changes since v3:<br>
> - added clk_prepare() in fimd_probe() and clk_unprepare() in fimd_remove()<br>
> as suggested by Viresh Kumar <<a href="mailto:viresh.kumar@linaro.org" target="_blank">viresh.kumar@linaro.org</a>><br>
> Changes since v2:<br>
> - moved clk_prepare_enable() and clk_disable_unprepare() from<br>
> fimd_probe() to fimd_clock() as suggested by Inki Dae <<a href="mailto:inki.dae@samsung.com" target="_blank">inki.dae@samsung.com</a>><br>
> Changes since v1:<br>
> - added error checking for clk_prepare_enable() and also replaced<br>
> clk_disable() with clk_disable_unprepare() during exit.<br>
> ---<br>
> drivers/gpu/drm/exynos/exynos_drm_fimd.c | 14 ++++++++++++--<br>
> 1 file changed, 12 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c<br>
> index 9537761..aa22370 100644<br>
> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c<br>
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c<br>
> @@ -934,6 +934,16 @@ static int fimd_probe(struct platform_device *pdev)<br>
> return ret;<br>
> }<br>
><br>
> + ret = clk_prepare(ctx->bus_clk);<br>
> + if (ret < 0)<br>
> + return ret;<br>
> +<br>
> + ret = clk_prepare(ctx->lcd_clk);<br>
> + if (ret < 0) {<br>
> + clk_unprepare(ctx->bus_clk);<br>
> + return ret;<br>
> + }<br>
> +<br>
> ctx->vidcon0 = pdata->vidcon0;<br>
> ctx->vidcon1 = pdata->vidcon1;<br>
> ctx->default_win = pdata->default_win;<br>
> @@ -981,8 +991,8 @@ static int fimd_remove(struct platform_device *pdev)<br>
> if (ctx->suspended)<br>
> goto out;<br>
><br>
> - clk_disable(ctx->lcd_clk);<br>
> - clk_disable(ctx->bus_clk);<br>
> + clk_unprepare(ctx->lcd_clk);<br>
> + clk_unprepare(ctx->bus_clk);<br>
<br>
</div></div>This looks wrong again.. You still need to call clk_disable() to make<br>
clk enabled<br>
count zero...<br>
</blockquote></div><br></div><div class="gmail_extra"> Viresh had an suggestion, that the original code had a call clk_disable() in fimd_remove(), which is really NOT required as there is NO clk_enable() in fimd_probe() and we can right away delete clk_disable() from fimd_remove().<br>
<br>And also i think i should be breaking this patch into 2, 1st patch for adding clk_prepare_enable() ( if we want remove dependency on RUNTIME PM ) in fimd_probe() for CCF migration another one for idea of replacing clk_disable() with adding clk_disable_unprepare() (since we will be adding clk_prepare_enable() in probe ) in fimd_remove() .<br>
</div><div class="gmail_extra"><br>
Mr. Inki Dae any thoughts on this.<br clear="all"></div><div class="gmail_extra"><br>-- <br>Thanks and Regards<div> Vikas Sajjan</div>
</div></div>