From: Joseph Lo <josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Cc: "linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH V4 4/9] ARM: tegra: pm: add platform suspend support
Date: Wed, 20 Mar 2013 18:26:39 +0800 [thread overview]
Message-ID: <1363775199.5697.31.camel@jlo-ubuntu-64.nvidia.com> (raw)
In-Reply-To: <51489B5D.3050101-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
On Wed, 2013-03-20 at 01:07 +0800, Stephen Warren wrote:
> On 03/18/2013 02:13 AM, Joseph Lo wrote:
> > Adding suspend to RAM support for Tegra platform. There are three suspend
> > mode for Tegra. The difference were below.
> >
> > * LP2: CPU voltage off
> > * LP1: CPU voltage off, DRAM in self-refresh
> > * LP0: CPU + Core voltage off, DRAM in self-refresh
> >
> > After this patch, the LP2 suspend mode will be supported.
>
> > diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
> > index c84505c..024f355 100644
> > --- a/arch/arm/mach-tegra/common.c
> > +++ b/arch/arm/mach-tegra/common.c
> > @@ -66,6 +66,7 @@ void __init tegra_dt_init_irq(void)
> > tegra_init_irq();
> > irqchip_init();
> > tegra_legacy_irq_syscore_init();
> > + tegra_init_suspend();
>
> Does that have to be part of tegra_dt_init_irq()? Can't we initialize
> suspend support in some later hook. init_irq() should just initialize IRQs.
>
I can re-check the sequence later.
> > diff --git a/arch/arm/mach-tegra/pmc.c b/arch/arm/mach-tegra/pmc.c
>
> > -void set_power_timers(unsigned long us_on, unsigned long us_off)
> > +static void set_power_timers(u32 us_on, u32 us_off, unsigned long rate)
> > {
> > unsigned long long ticks;
> > unsigned long long pclk;
> > - unsigned long rate;
> > static unsigned long tegra_last_pclk;
> >
> > - rate = clk_get_rate(tegra_pclk);
> > -
> > if (WARN_ON_ONCE(rate <= 0))
> > pclk = 100000000;
> > else
>
> I don't think the code compiles after that?
>
> The code must both compile and execute correctly after each patch is
> applied, without relying on any future patches.
>
It's OK. I had checked this before sending the patch.
> > +void tegra_pmc_pm_set(enum tegra_suspend_mode mode)
> > +{
> > + u32 reg;
> > + unsigned long rate = 0;
> > +
> > + reg = tegra_pmc_readl(PMC_CTRL);
> > + reg |= TEGRA_POWER_CPU_PWRREQ_OE;
> > + reg &= ~TEGRA_POWER_EFFECT_LP0;
> > +
> > + switch (mode) {
> > + case TEGRA_SUSPEND_LP2:
> > + rate = clk_get_rate(tegra_pclk);
>
> That isn't used anywhere.
>
It will pass to set_power_timers().
> > +void tegra_pmc_suspend_init(void)
> > +{
> > + u32 reg;
> > +
> > + /* Always enable CPU power request; just normal polarity is supported */
> > + reg = tegra_pmc_readl(PMC_CTRL);
> > + BUG_ON(reg & TEGRA_POWER_CPU_PWRREQ_POLARITY);
>
> Why is that comment true? What does it take to support arbitrary
> polarity; just flipping the OE bit in the register?
Hmm. You are right. I think this is redundant if we support different
polarity setting. We should also add it into DT binding. So we can just
flip the OE bit here.
next prev parent reply other threads:[~2013-03-20 10:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-18 8:13 [PATCH V4 0/9] ARM: tegra: add platform suspend support Joseph Lo
[not found] ` <1363594400-11663-1-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-03-18 8:13 ` [PATCH V4 1/9] gpio: tegra: add gpio wakeup source handling Joseph Lo
[not found] ` <1363594400-11663-2-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-03-19 16:52 ` Stephen Warren
2013-03-18 8:13 ` [PATCH V4 2/9] ARM: tegra: irq: add wake up handling Joseph Lo
[not found] ` <1363594400-11663-3-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-03-19 16:55 ` Stephen Warren
2013-03-18 8:13 ` [PATCH V4 3/9] ARM: dt: tegra: add bindings of power management configurations for PMC Joseph Lo
[not found] ` <1363594400-11663-4-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-03-19 17:00 ` Stephen Warren
[not found] ` <5148999A.90102-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-03-19 17:26 ` Stephen Warren
2013-03-18 8:13 ` [PATCH V4 4/9] ARM: tegra: pm: add platform suspend support Joseph Lo
[not found] ` <1363594400-11663-5-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-03-19 17:07 ` Stephen Warren
[not found] ` <51489B5D.3050101-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-03-20 10:26 ` Joseph Lo [this message]
2013-03-18 8:13 ` [PATCH V4 5/9] ARM: dts: tegra: add power gpio keys to DT Joseph Lo
2013-03-18 8:13 ` [PATCH V4 6/9] ARM: dts: tegra: whistler: add wakeup source for KBC Joseph Lo
2013-03-18 8:13 ` [PATCH V4 7/9] ARM: dts: tegra: add non-removable and keep-power-in-suspend property for MMC Joseph Lo
2013-03-18 8:13 ` [PATCH V4 8/9] ARM: tegra: config: defconfig update Joseph Lo
2013-03-18 8:13 ` [PATCH V4 9/9] ARM: dts: tegra: add the PM configurations of PMC Joseph Lo
2013-03-19 16:51 ` [PATCH V4 0/9] ARM: tegra: add platform suspend support Stephen Warren
[not found] ` <5148977F.7000700-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-03-20 10:15 ` Joseph Lo
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=1363775199.5697.31.camel@jlo-ubuntu-64.nvidia.com \
--to=josephl-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.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;
as well as URLs for NNTP newsgroup(s).