public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tero Kristo <t-kristo@ti.com>
To: Jean Pihet <jean.pihet@newoldbits.com>
Cc: linux-omap@vger.kernel.org, khilman@ti.com, nm@ti.com
Subject: Re: [PATCHv4 11/15] omap3+: voltage/pwrdm/clkdm/clock add recursive usecount tracking
Date: Wed, 30 Nov 2011 12:11:12 +0200	[thread overview]
Message-ID: <1322647872.21753.18.camel@sokoban> (raw)
In-Reply-To: <CAORVsuVMaEZBSPpQ8-jCju7hfCMBFkQ9r2z_ArT-b4dN0pqbcg@mail.gmail.com>

On Wed, 2011-11-30 at 10:52 +0100, Jean Pihet wrote:
> Hi Tero,
> 
> On Fri, Nov 25, 2011 at 4:49 PM, Tero Kristo <t-kristo@ti.com> wrote:
> > This patch fixes the usecount tracking for omap3+, previously the
> > usecount numbers were rather bogus and were not really useful for
> > any purpose. Now usecount numbers track the number of really active
> > clients on each domain. This patch also adds support for usecount
> > tracking on powerdomain and voltagedomain levels.
> >
> > Signed-off-by: Tero Kristo <t-kristo@ti.com>
> > ---
> >  arch/arm/mach-omap2/clkt_iclk.c         |   11 +++++++++
> >  arch/arm/mach-omap2/clockdomain.c       |   38 +++++++++++++++++++++++++++++-
> >  arch/arm/mach-omap2/clockdomain.h       |    3 ++
> >  arch/arm/mach-omap2/powerdomain.c       |   12 +++++++++
> >  arch/arm/mach-omap2/powerdomain.h       |    5 ++++
> >  arch/arm/mach-omap2/voltage.c           |   30 ++++++++++++++++++++++++
> >  arch/arm/mach-omap2/voltage.h           |    7 +++++
> >  arch/arm/plat-omap/clock.c              |    2 +
> >  arch/arm/plat-omap/include/plat/clock.h |    1 +
> >  9 files changed, 107 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/arm/mach-omap2/clkt_iclk.c b/arch/arm/mach-omap2/clkt_iclk.c
> > index 3d43fba..8e61776 100644
> > --- a/arch/arm/mach-omap2/clkt_iclk.c
> > +++ b/arch/arm/mach-omap2/clkt_iclk.c
> > @@ -21,6 +21,7 @@
> >  #include "clock2xxx.h"
> >  #include "cm2xxx_3xxx.h"
> >  #include "cm-regbits-24xx.h"
> > +#include "clockdomain.h"
> >
> >  /* Private functions */
> >
> > @@ -34,6 +35,11 @@ void omap2_clkt_iclk_allow_idle(struct clk *clk)
> >        v = __raw_readl((__force void __iomem *)r);
> >        v |= (1 << clk->enable_bit);
> >        __raw_writel(v, (__force void __iomem *)r);
> > +
> > +       if (clk->usecount && clk->clkdm)
> > +               clkdm_usecount_dec(clk->clkdm);
> Is the test on clk->usecount needed? Is that a problem when usecount reaches 0?

Yea, this check is needed because we don't really know whether the clock
is active or not when allow_idle is called. If it is active, we want to
decrease the clkdm usecount as this clock has increased the usecount on
that domain when it was enabled, otherwise not.

> 
> > +
> > +       clk->autoidle = 1;
> >  }
> >
> >  /* XXX */
> > @@ -46,6 +52,11 @@ void omap2_clkt_iclk_deny_idle(struct clk *clk)
> >        v = __raw_readl((__force void __iomem *)r);
> >        v &= ~(1 << clk->enable_bit);
> >        __raw_writel(v, (__force void __iomem *)r);
> > +
> > +       if (clk->usecount && clk->clkdm)
> > +               clkdm_usecount_inc(clk->clkdm);
> Same here.

Same deal, but other way around.

-Tero

> 
> > +
> > +       clk->autoidle = 0;
> >  }
> >
> >  /* Public data */
> ...
> 
> Regards,
> Jean



  reply	other threads:[~2011-11-30 10:11 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-25 15:49 [PATCHv4 00/15] voltdm cleanup + auto-ret / auto-off support Tero Kristo
2011-11-25 15:49 ` [PATCHv4 01/15] OMAP3+: PM: VP: use uV for max and min voltage limits Tero Kristo
2011-12-09 18:07   ` Kevin Hilman
2011-12-12  9:39     ` Tero Kristo
2011-11-25 15:49 ` [PATCHv4 02/15] omap3+: voltage: parameter segregation Tero Kristo
2011-11-29 18:26   ` Menon, Nishanth
2011-11-30 10:07     ` Tero Kristo
2011-11-30 12:31       ` Menon, Nishanth
2011-11-30 13:04         ` Tero Kristo
2011-11-30 10:11   ` Jean Pihet
2011-11-25 15:49 ` [PATCHv4 03/15] omap: voltage: add definition for pmic startup / shutdown times Tero Kristo
2011-11-25 15:49 ` [PATCHv4 04/15] omap4: add " Tero Kristo
2011-11-29 18:30   ` Menon, Nishanth
2011-11-30  9:45     ` Tero Kristo
2011-11-30 12:20       ` Menon, Nishanth
2011-11-30 13:08         ` Tero Kristo
2011-11-25 15:49 ` [PATCHv4 05/15] omap: add support for oscillator setup Tero Kristo
2011-12-09 18:27   ` Kevin Hilman
2011-12-12  9:40     ` Tero Kristo
2011-11-25 15:49 ` [PATCHv4 06/15] omap3+: vp: use new vp_params for calculating vddmin and vddmax Tero Kristo
2011-11-29 18:34   ` Menon, Nishanth
2011-11-25 15:49 ` [PATCHv4 07/15] omap3+: voltage: use oscillator data to calculate setup times Tero Kristo
2011-11-25 15:49 ` [PATCHv4 08/15] omap4: use pmic params for calculating pmic " Tero Kristo
2011-11-25 15:49 ` [PATCHv4 09/15] TEMP: OMAP3: beagle rev-c4: enable OPP6 Tero Kristo
2011-11-25 15:49 ` [PATCHv4 10/15] omap: beagle: set oscillator startup time to 10ms for rev c4 Tero Kristo
2011-12-09 19:11   ` Kevin Hilman
2011-12-12  9:42     ` Tero Kristo
2011-11-25 15:49 ` [PATCHv4 11/15] omap3+: voltage/pwrdm/clkdm/clock add recursive usecount tracking Tero Kristo
2011-11-30  9:52   ` Jean Pihet
2011-11-30 10:11     ` Tero Kristo [this message]
2011-12-09 19:37   ` Kevin Hilman
2011-12-12  9:45     ` Tero Kristo
2011-11-25 15:49 ` [PATCHv4 12/15] vc: omap3: auto_ret / auto_off support Tero Kristo
2011-12-09 20:13   ` Kevin Hilman
2011-12-12  9:53     ` Tero Kristo
2011-12-12 15:05       ` Kevin Hilman
2011-11-25 15:49 ` [PATCHv4 13/15] omap3: fix usecount tracking Tero Kristo
2011-11-25 15:49 ` [PATCHv4 14/15] omap3: voltage: fix channel configuration Tero Kristo
2011-11-25 15:49 ` [PATCHv4 15/15] omap: pm: wait for domain wakeup if changing state of idle domain Tero Kristo
2011-11-30 10:06 ` [PATCHv4 00/15] voltdm cleanup + auto-ret / auto-off support Jean Pihet
2011-11-30 10:19   ` Tero Kristo
2011-12-09 20:23 ` Kevin Hilman
2011-12-12  9:38   ` Tero Kristo

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=1322647872.21753.18.camel@sokoban \
    --to=t-kristo@ti.com \
    --cc=jean.pihet@newoldbits.com \
    --cc=khilman@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox