All of lore.kernel.org
 help / color / mirror / Atom feed
From: Inki Dae <inki.dae@samsung.com>
To: Tomasz Figa <tomasz.figa@gmail.com>
Cc: linux-samsung-soc@vger.kernel.org,
	"patches@linaro.org" <patches@linaro.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	DRI mailing list <dri-devel@lists.freedesktop.org>,
	Kukjin Kim <kgene.kim@samsung.com>,
	Vikas Sajjan <vikas.sajjan@linaro.org>,
	linaro-kernel@lists.linaro.org,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>
Subject: Re: [PATCH v4] drm/exynos: prepare FIMD clocks
Date: Sun, 21 Apr 2013 22:36:08 +0900	[thread overview]
Message-ID: <CAAQKjZOg+H=Dnd3HWEWKjQq6e2UGZvX6s0waBdqsxx=CEAXtQw@mail.gmail.com> (raw)
In-Reply-To: <56942397.CYxnWkv4Nb@flatron>


[-- Attachment #1.1: Type: text/plain, Size: 4429 bytes --]

2013/4/21 Tomasz Figa <tomasz.figa@gmail.com>

> Hi,
>
> On Monday 08 of April 2013 16:41:54 Viresh Kumar wrote:
> > On 8 April 2013 16:37, Vikas Sajjan <vikas.sajjan@linaro.org> wrote:
> > > While migrating to common clock framework (CCF), I found that the FIMD
> > > clocks were pulled down by the CCF.
> > > If CCF finds any clock(s) which has NOT been claimed by any of the
> > > drivers, then such clock(s) are PULLed low by CCF.
> > >
> > > Calling clk_prepare() for FIMD clocks fixes the issue.
> > >
> > > This patch also replaces clk_disable() with clk_unprepare() during
> > > exit, since clk_prepare() is called in fimd_probe().
> >
> > I asked you about fixing your commit log too.. It still looks incorrect
> > to me.
> >
> > This patch doesn't have anything to do with CCF pulling clocks down, but
> > calling clk_prepare() before clk_enable() is must now.. that's it..
> > nothing more.
> >
>
> I fully agree.
>
> The message should be something like:
>
> Common Clock Framework introduced the need to prepare clocks before
> enabling them, otherwise clk_enable() fails. This patch adds clk_prepare
> calls to the driver.
>
> and that's all.
>
> What you are observing as "CCF pulling clocks down" is the fact that
> clk_enable() fails if the clock is not prepared and so the clock is not
> enabled in result.
>
> Another thing is that CCF is not pulling anything down. GPIO pins can be
> pulled down (or up or not pulled), but clocks can be masked, gated or
> simply disabled - this does not imply their signal level.
>
> > > Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
> > > ---
> > >
> > > Changes since v3:
> > >         - added clk_prepare() in fimd_probe() and clk_unprepare() in
> > >         fimd_remove()>
> > >          as suggested by Viresh Kumar <viresh.kumar@linaro.org>
> > >
> > > Changes since v2:
> > >         - moved clk_prepare_enable() and clk_disable_unprepare() from
> > >         fimd_probe() to fimd_clock() as suggested by Inki Dae
> > >         <inki.dae@samsung.com>>
> > > Changes since v1:
> > >         - added error checking for clk_prepare_enable() and also
> > >         replaced
> > >         clk_disable() with clk_disable_unprepare() during exit.
> > >
> > > ---
> > >
> > >  drivers/gpu/drm/exynos/exynos_drm_fimd.c |   14 ++++++++++++--
> > >  1 file changed, 12 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> > > b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 9537761..aa22370
> > > 100644
> > > --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> > > +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
> > > @@ -934,6 +934,16 @@ static int fimd_probe(struct platform_device
> > > *pdev)>
> > >                 return ret;
> > >
> > >         }
> > >
> > > +       ret = clk_prepare(ctx->bus_clk);
> > > +       if (ret < 0)
> > > +               return ret;
> > > +
> > > +       ret = clk_prepare(ctx->lcd_clk);
> > > +       if  (ret < 0) {
> > > +               clk_unprepare(ctx->bus_clk);
> > > +               return ret;
> > > +       }
> > > +
>
> Why not just simply use clk_prepare_enable() instead of all calls to
> clk_enable() in the driver?
>
> Same goes for s/clk_disable/clk_disable_unprepare/ .
>
>
I agree with you. Using clk_prepare_enable() is more clear. Actually I had
already commented on this. Please see the patch v2. But this way also looks
good to me.



> > >
> > >         ctx->vidcon0 = pdata->vidcon0;
> > >         ctx->vidcon1 = pdata->vidcon1;
> > >         ctx->default_win = pdata->default_win;
> > >
> > > @@ -981,8 +991,8 @@ static int fimd_remove(struct platform_device
> > > *pdev)>
> > >         if (ctx->suspended)
> > >
> > >                 goto out;
> > >
> > > -       clk_disable(ctx->lcd_clk);
> > > -       clk_disable(ctx->bus_clk);
> > > +       clk_unprepare(ctx->lcd_clk);
> > > +       clk_unprepare(ctx->bus_clk);
> >
> > This looks wrong again.. You still need to call clk_disable() to make
> > clk enabled
> > count zero...
>
> Viresh is right again here.
>
>
Ok, you two guys say together this looks wrong so I'd like to take more
checking. I thought that clk->clk_enable is 1 at here and it would be 0 by
pm_runtimg_put_sync(). Is there any my missing point?


> Best regards,
> Tomasz
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>

[-- Attachment #1.2: Type: text/html, Size: 6604 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2013-04-21 13:36 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-08 11:07 [PATCH v4] drm/exynos: prepare FIMD clocks Vikas Sajjan
2013-04-08 11:11 ` Viresh Kumar
2013-04-19  8:55   ` Vikas Sajjan
2013-04-20 15:26     ` Inki Dae
2013-04-21  7:24       ` Vikas Sajjan
2013-04-21  7:53       ` Viresh Kumar
2013-04-21 10:35         ` Tomasz Figa
2013-04-21 14:05           ` Inki Dae
2013-04-21 14:15             ` Tomasz Figa
2013-04-21 10:26   ` Tomasz Figa
2013-04-21 13:36     ` Inki Dae [this message]
2013-04-21 14:43       ` Tomasz Figa
2013-04-22  5:11         ` Inki Dae
2013-04-22  9:52           ` Tomasz Figa
2013-04-22 10:03             ` Inki Dae
2013-04-22 10:17               ` Sylwester Nawrocki
2013-04-22 10:20                 ` Inki Dae
2013-04-22 10:37                 ` Tomasz Figa
2013-04-22 11:42                   ` Rafael J. Wysocki
2013-04-22 12:04                     ` Inki Dae
2013-04-23 11:51                       ` myungjoo.ham
2013-04-23 12:09                         ` Inki Dae
2013-04-22 11:52                   ` Inki Dae
2013-04-22  5:14         ` Viresh Kumar
2013-04-22  9:56           ` Tomasz Figa
2013-04-22 10:05             ` Sylwester Nawrocki
2013-04-22 12:30               ` Tomasz Figa
2013-04-22 10:26             ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAQKjZOg+H=Dnd3HWEWKjQq6e2UGZvX6s0waBdqsxx=CEAXtQw@mail.gmail.com' \
    --to=inki.dae@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kgene.kim@samsung.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=tomasz.figa@gmail.com \
    --cc=vikas.sajjan@linaro.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.