public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: t-kristo@ti.com (Tero Kristo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/6] arm: omap3: add manual control for mpu_iva voltdm usecounting
Date: Wed, 15 Feb 2012 10:16:05 +0200	[thread overview]
Message-ID: <1329293765.4102.335.camel@sokoban> (raw)
In-Reply-To: <8762f96wdk.fsf@ti.com>

On Tue, 2012-02-14 at 11:35 -0800, Kevin Hilman wrote:
> Tero Kristo <t-kristo@ti.com> writes:
> 
> > mpu_iva voltdm usecount is now decreased during idle. This will
> > allow the voltagedomain to reflect actual usage, and will allow
> > proper usage of vc callbacks.
> 
> I don't follow why this is needed in the idle path.
> 
> Why aren't the usecounts from clock/powerdomain disables (enables) causing this
> voltdm disable (enable) to happen automatcially?

The main issue is mpu powerdomain which doesn't contain any clocks that
are controlled actively. Without adding a "virtual" usecount
enable/disable hook, the usecount for mpu_iva will always remain at 0
(or just follow the iva domain on omap3.) We want the usecount to
reflect the actual idling of this domain also, so that we can control
SR / auto-ret based on MPU activity.

> If these are needed, seems like they should be in the
> pwrdm_[pre|post]_transition() hooks so they can be generic.

This is actually a good idea, I could move them here. I could also add a
manual triggering for core domain here, as I have a feeling it might be
good to have so that core will also follow the idle cycle more tightly
(basically as a virtual follow for sdrc clock which is idled by HW
during wfi.)

-Tero

> 
> Kevin
> 
> > Signed-off-by: Tero Kristo <t-kristo@ti.com>
> > Cc: Paul Walmsley <paul@pwsan.com>
> > Cc: Kevin Hilman <khilman@ti.com>
> > ---
> >  arch/arm/mach-omap2/pm34xx.c |    8 ++++++++
> >  1 files changed, 8 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> > index fc69875..14defaf 100644
> > --- a/arch/arm/mach-omap2/pm34xx.c
> > +++ b/arch/arm/mach-omap2/pm34xx.c
> > @@ -74,6 +74,7 @@ void (*omap3_do_wfi_sram)(void);
> >  static struct powerdomain *mpu_pwrdm, *neon_pwrdm;
> >  static struct powerdomain *core_pwrdm, *per_pwrdm;
> >  static struct powerdomain *cam_pwrdm;
> > +static struct voltagedomain *mpu_iva_voltdm;
> >  
> >  static inline void omap3_per_save_context(void)
> >  {
> > @@ -311,6 +312,8 @@ void omap_sram_idle(void)
> >  		return;
> >  	}
> >  
> > +	voltdm_pwrdm_disable(mpu_iva_voltdm);
> > +
> >  	/* NEON control */
> >  	if (pwrdm_read_pwrst(neon_pwrdm) == PWRDM_POWER_ON)
> >  		pwrdm_set_next_pwrst(neon_pwrdm, mpu_next_state);
> > @@ -393,6 +396,8 @@ void omap_sram_idle(void)
> >  	}
> >  	omap3_intc_resume_idle();
> >  
> > +	voltdm_pwrdm_enable(mpu_iva_voltdm);
> > +
> >  	pwrdm_post_transition();
> >  
> >  	/* PER */
> > @@ -828,6 +833,9 @@ static int __init omap3_pm_init(void)
> >  
> >  	(void) clkdm_for_each(clkdms_setup, NULL);
> >  
> > +	mpu_iva_voltdm = voltdm_lookup("mpu_iva");
> > +	voltdm_pwrdm_enable(mpu_iva_voltdm);
> > +
> >  	mpu_pwrdm = pwrdm_lookup("mpu_pwrdm");
> >  	if (mpu_pwrdm == NULL) {
> >  		printk(KERN_ERR "Failed to get mpu_pwrdm\n");

  reply	other threads:[~2012-02-15  8:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-14 16:36 [PATCH 0/6] arm: omap: clk/clkdm/pwrdm/voltdm changes to usecounting Tero Kristo
2012-02-14 16:36 ` [PATCH 1/6] arm: omap: clk: add support for omap_clk_for_each Tero Kristo
2012-02-14 16:36 ` [PATCH 2/6] arm: omap3+: voltage/pwrdm/clkdm/clock add recursive usecount tracking Tero Kristo
2012-02-14 16:36 ` [PATCH 3/6] arm: omap3+: voltage: add support for voltagedomain usecounts Tero Kristo
2012-02-14 16:36 ` [PATCH 4/6] arm: omap3: add manual control for mpu_iva voltdm usecounting Tero Kristo
2012-02-14 19:35   ` Kevin Hilman
2012-02-15  8:16     ` Tero Kristo [this message]
2012-02-15 19:29       ` Kevin Hilman
2012-02-14 16:36 ` [PATCH 5/6] arm: omap3: set autoidle flags for a few clocks Tero Kristo
2012-02-14 16:36 ` [PATCH 6/6] arm: omap: pm-debug: enhanced usecount debug support Tero Kristo
2012-02-14 20:27   ` Tony Lindgren
2012-02-14 22:59     ` Kevin Hilman
2012-02-14 23:52       ` Tony Lindgren
2012-02-15  8:34         ` Tero Kristo
2012-02-15 15:20           ` Kevin Hilman
2012-02-16 17:06             ` Menon, Nishanth
2012-02-16 17:35               ` Kevin Hilman
2012-02-16 18:14                 ` Menon, Nishanth
2012-02-14 20:02 ` [PATCH 0/6] arm: omap: clk/clkdm/pwrdm/voltdm changes to usecounting Kevin Hilman

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=1329293765.4102.335.camel@sokoban \
    --to=t-kristo@ti.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox