All of lore.kernel.org
 help / color / mirror / Atom feed
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/6] pinctrl: Update clock handling for the pinctrl-nomadik GPIO driver
Date: Thu, 25 Oct 2012 08:31:27 +0100	[thread overview]
Message-ID: <20121025073127.GB971@gmail.com> (raw)
In-Reply-To: <CACRpkdaeBW2ecQZ2fA-hL8o47pYpjZ=5Mn131F87u58rX+dekw@mail.gmail.com>

On Wed, 24 Oct 2012, Linus Walleij wrote:

> On Wed, Oct 24, 2012 at 4:45 PM, Lee Jones <lee.jones@linaro.org> wrote:
> 
> > The clock framework has changed somewhat and it's now better to
> > invoke clock_prepare_enable() and clk_disable_unprepare() rather
> > than the legacy clk_enable() and clk_disable() calls. This patch
> > converts the Nomadik Pin Control driver to the new framework.
> >
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> 
> (...)
> > -               clk_enable(chip->clk);
> > +               clk_prepare_enable(chip->clk);
> (...)
> > -               clk_disable(chip->clk);
> > +               clk_disable_unprepare(chip->clk);
> 
> (Repeated for each occurence.)
> 
> Is this *really* causing a regression? I mean the driver
> begin like this in nmk_gpio_probe():
> 
>         clk = devm_clk_get(&dev->dev, NULL);
>         if (IS_ERR(clk)) {
>                 ret = PTR_ERR(clk);
>                 goto out;
>         }
>         clk_prepare(clk);
> 
> Then it leaves the clock prepared. So the clock is always
> prepared. You would only need to enable/disable it at times.
> 
> And the semantics of the clk_enable/clk_disable call pair
> is such that it is fastpath and should be real quick, and that
> is exactly why we're using it repeatedly like that. Inserting
> clk_unprepare() effectively could make the whole driver a
> lot slower, so convince me on this one. ...
> 
> I suspect the real bug (if there is one) must be in the clock
> implementation.

This certainly doesn't fix the bug we spoke about. I believe Ulf
is still working on that one.

So do you want me to remove this patch?

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

WARNING: multiple messages have this Message-ID (diff)
From: Lee Jones <lee.jones@linaro.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, arnd@arndb.de,
	linus.walleij@stericsson.com
Subject: Re: [PATCH 2/6] pinctrl: Update clock handling for the pinctrl-nomadik GPIO driver
Date: Thu, 25 Oct 2012 08:31:27 +0100	[thread overview]
Message-ID: <20121025073127.GB971@gmail.com> (raw)
In-Reply-To: <CACRpkdaeBW2ecQZ2fA-hL8o47pYpjZ=5Mn131F87u58rX+dekw@mail.gmail.com>

On Wed, 24 Oct 2012, Linus Walleij wrote:

> On Wed, Oct 24, 2012 at 4:45 PM, Lee Jones <lee.jones@linaro.org> wrote:
> 
> > The clock framework has changed somewhat and it's now better to
> > invoke clock_prepare_enable() and clk_disable_unprepare() rather
> > than the legacy clk_enable() and clk_disable() calls. This patch
> > converts the Nomadik Pin Control driver to the new framework.
> >
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> 
> (...)
> > -               clk_enable(chip->clk);
> > +               clk_prepare_enable(chip->clk);
> (...)
> > -               clk_disable(chip->clk);
> > +               clk_disable_unprepare(chip->clk);
> 
> (Repeated for each occurence.)
> 
> Is this *really* causing a regression? I mean the driver
> begin like this in nmk_gpio_probe():
> 
>         clk = devm_clk_get(&dev->dev, NULL);
>         if (IS_ERR(clk)) {
>                 ret = PTR_ERR(clk);
>                 goto out;
>         }
>         clk_prepare(clk);
> 
> Then it leaves the clock prepared. So the clock is always
> prepared. You would only need to enable/disable it at times.
> 
> And the semantics of the clk_enable/clk_disable call pair
> is such that it is fastpath and should be real quick, and that
> is exactly why we're using it repeatedly like that. Inserting
> clk_unprepare() effectively could make the whole driver a
> lot slower, so convince me on this one. ...
> 
> I suspect the real bug (if there is one) must be in the clock
> implementation.

This certainly doesn't fix the bug we spoke about. I believe Ulf
is still working on that one.

So do you want me to remove this patch?

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2012-10-25  7:31 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-24 14:45 [PATCH 0/6] ux500 fixes bound for the -rcs Lee Jones
2012-10-24 14:45 ` Lee Jones
2012-10-24 14:45 ` [PATCH 1/6] mfd: ab8500-core: Remove unused ab8500-gpio IRQ ranges Lee Jones
2012-10-24 14:45   ` Lee Jones
2012-10-24 17:37   ` Linus Walleij
2012-10-24 17:37     ` Linus Walleij
2012-10-24 14:45 ` [PATCH 2/6] pinctrl: Update clock handling for the pinctrl-nomadik GPIO driver Lee Jones
2012-10-24 14:45   ` Lee Jones
2012-10-24 17:32   ` Linus Walleij
2012-10-24 17:32     ` Linus Walleij
2012-10-25  7:31     ` Lee Jones [this message]
2012-10-25  7:31       ` Lee Jones
2012-10-25  7:57       ` Linus Walleij
2012-10-25  7:57         ` Linus Walleij
2012-10-25  8:23         ` Lee Jones
2012-10-25  8:23           ` Lee Jones
2012-10-25  9:29           ` Ulf Hansson
2012-10-25  9:29             ` Ulf Hansson
2012-10-25  9:44             ` Lee Jones
2012-10-25  9:44               ` Lee Jones
2012-10-25 12:33             ` Linus Walleij
2012-10-25 12:33               ` Linus Walleij
2012-10-25 12:07           ` Linus Walleij
2012-10-25 12:07             ` Linus Walleij
2012-10-25 12:41   ` Linus Walleij
2012-10-25 12:41     ` Linus Walleij
2012-10-25 13:07     ` Lee Jones
2012-10-25 13:07       ` Lee Jones
2012-10-25 13:13     ` Linus Walleij
2012-10-25 13:13       ` Linus Walleij
2012-10-25 15:51       ` Lee Jones
2012-10-25 15:51         ` Lee Jones
2012-10-25 16:03         ` Linus Walleij
2012-10-25 16:03           ` Linus Walleij
2012-11-14 13:18           ` Lee Jones
2012-11-14 13:18             ` Lee Jones
2012-11-14 14:37             ` Linus Walleij
2012-11-14 14:37               ` Linus Walleij
2012-10-24 14:45 ` [PATCH 3/6] ARM: ux500: Fix build error relating to IRQCHIP_SKIP_SET_WAKE Lee Jones
2012-10-24 14:45   ` Lee Jones
2012-10-24 14:45 ` [PATCH 4/6] ARM: ux500: Specify AMBA Primecell IDs for Nomadik I2C in DT Lee Jones
2012-10-24 14:45   ` Lee Jones
2012-10-24 17:47   ` Linus Walleij
2012-10-24 17:47     ` Linus Walleij
2012-10-24 14:45 ` [PATCH 5/6] ARM: ux500: Correct SDI5 address and add some format changes Lee Jones
2012-10-24 14:45   ` Lee Jones
2012-10-24 17:48   ` Linus Walleij
2012-10-24 17:48     ` Linus Walleij
2012-10-24 14:45 ` [PATCH 6/6] ARM: ux500: Convert DT_MACHINE_START to use SMP operations Lee Jones
2012-10-24 14:45   ` Lee Jones
2012-10-24 17:48   ` Linus Walleij
2012-10-24 17:48     ` Linus Walleij
2012-10-24 17:46 ` [PATCH 0/6] ux500 fixes bound for the -rcs Linus Walleij
2012-10-24 17:46   ` Linus Walleij

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=20121025073127.GB971@gmail.com \
    --to=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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.