From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 02/11] ARM: OMAP3: Fix idle mode signaling for sys_clkreq and sys_off_mode
Date: Tue, 15 Apr 2014 15:56:00 -0700 [thread overview]
Message-ID: <20140415225559.GA5313@atomide.com> (raw)
In-Reply-To: <CANOLnOO=O8xkTV9LiH+JTtmEXd9ihu0+ZYoHtrQK2QsFWOWVbg@mail.gmail.com>
* Grazvydas Ignotas <notasas@gmail.com> [140414 15:51]:
> On Fri, Apr 11, 2014 at 2:47 AM, Tony Lindgren <tony@atomide.com> wrote:
> > @@ -282,6 +283,7 @@ void omap_sram_idle(void)
> >
> > /* CORE */
> > if (core_next_state < PWRDM_POWER_ON) {
> > + omap3_vc_set_pmic_signaling(core_next_state);
>
> I wonder how is it going to affect latencies, adding stuff to suspend
> path hurts things like NAND transfers, which consist of lots of small
> blocks with an interrupt after each..
For most part this is the completely idle path, so there should
not be much of hurry. Most devices should already block the deeper
idle states for the devices listed in cm_idlest_per, cm_idlest1_core
and cm_idlest3_core registers. So it should be mostly automatic with
runtime PM.
No idea what happens with GPMC though for NAND transfers :) Might
be worth checking.
> > +void omap3_vc_set_pmic_signaling(int core_next_state)
> > +{
> > + u32 voltctrl;
> > +
> > + voltctrl = omap2_prm_read_mod_reg(OMAP3430_GR_MOD,
> > + OMAP3_PRM_VOLTCTRL_OFFSET);
> > + switch (core_next_state) {
> > + case PWRDM_POWER_OFF:
> > + voltctrl &= ~(OMAP3430_PRM_VOLTCTRL_AUTO_RET |
> > + OMAP3430_PRM_VOLTCTRL_AUTO_SLEEP);
> > + voltctrl |= OMAP3430_PRM_VOLTCTRL_AUTO_OFF;
> > + break;
> > + case PWRDM_POWER_RET:
> > + voltctrl &= ~(OMAP3430_PRM_VOLTCTRL_AUTO_OFF |
> > + OMAP3430_PRM_VOLTCTRL_AUTO_SLEEP);
> > + voltctrl |= OMAP3430_PRM_VOLTCTRL_AUTO_RET;
> > + break;
> > + default:
> > + voltctrl &= ~(OMAP3430_PRM_VOLTCTRL_AUTO_OFF |
> > + OMAP3430_PRM_VOLTCTRL_AUTO_RET);
> > + voltctrl |= OMAP3430_PRM_VOLTCTRL_AUTO_SLEEP;
> > + break;
> > + }
> > + omap2_prm_write_mod_reg(voltctrl, OMAP3430_GR_MOD,
> > + OMAP3_PRM_VOLTCTRL_OFFSET);
>
> Could it only write if the value changed? Caching register value would
> be great too to avoid slow register accesses.
Yeah sure makes sense, I'll take a look at that. We should not need
to check for voltctrl constantly.
> > +}
> > +
> > +/*
> > + * Configure signal polarity for sys_clkreq and sys_off_mode pins
> > + * as the default values are wrong and can cause the system to hang
> > + * if any twl4030 sccripts are loaded.
>
> s/sccripts/scripts
Will fix.
> > + */
> > +static void __init omap3_vc_init_pmic_signaling(void)
> > +{
> > + u32 val, old;
> > +
> > + val = omap2_prm_read_mod_reg(OMAP3430_GR_MOD,
> > + OMAP3_PRM_POLCTRL_OFFSET);
> > + old = val;
> > +
> > + if (old & OMAP3430_PRM_POLCTRL_CLKREQ_POL)
> > + val |= OMAP3430_PRM_POLCTRL_CLKREQ_POL;
>
> Are these 2 lines actually doing anything?
Nope :) It should be if (!(old & OMAP3430_PRM_POLCTRL_CLKREQ_POL))...
> > + if (old & OMAP3430_PRM_POLCTRL_OFFMODE_POL)
> > + val &= ~OMAP3430_PRM_POLCTRL_OFFMODE_POL;
>
> Why not just clear the bit unconditionally?
Mostly for producing some kind of debug message of what's going on
in case somebody has a PMIC with different polarity. If we agree
that's not needed, then that's not needed.
> > + if (val != old) {
> > + pr_debug("PM: fixing sys_clkreq and sys_off_mode polarity 0x%x -> 0x%x\n",
> > + old, val);
> > + }
> > + omap2_prm_write_mod_reg(val, OMAP3430_GR_MOD,
> > + OMAP3_PRM_POLCTRL_OFFSET);
>
> Maybe move this write inside the block just above it?
Makes sense.
Tony
next prev parent reply other threads:[~2014-04-15 22:56 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-10 23:47 [PATCH 00/11] Fixes for omap PM for making omap3 DT only Tony Lindgren
2014-04-10 23:47 ` [PATCH 01/11] ARM: OMAP3: PM: remove access to PRM_VOLTCTRL register Tony Lindgren
2014-04-10 23:47 ` [PATCH 02/11] ARM: OMAP3: Fix idle mode signaling for sys_clkreq and sys_off_mode Tony Lindgren
2014-04-12 8:57 ` Tero Kristo
2014-04-12 15:02 ` Tony Lindgren
2014-04-23 7:51 ` Tero Kristo
2014-04-23 20:49 ` Tony Lindgren
2014-05-07 16:34 ` Tony Lindgren
2014-04-14 22:51 ` Grazvydas Ignotas
2014-04-15 22:56 ` Tony Lindgren [this message]
2014-04-16 13:58 ` Grazvydas Ignotas
2014-04-18 17:48 ` Tony Lindgren
2014-04-10 23:47 ` [PATCH 03/11] ARM: OMAP3: Disable broken omap3_set_off_timings function Tony Lindgren
2014-04-10 23:47 ` [PATCH 04/11] ARM: OMAP3: Fix voltage control for deeper idle states Tony Lindgren
2014-04-11 15:14 ` Tony Lindgren
2014-05-07 16:38 ` Tony Lindgren
2014-04-10 23:47 ` [PATCH 05/11] ARM: dts: Configure omap3 twl4030 I2C4 pins by default Tony Lindgren
2014-04-10 23:47 ` [PATCH 06/11] ARM: OMAP2+: Fix voltage scaling init for device tree Tony Lindgren
2014-05-19 17:50 ` Joachim Eastwood
2014-05-19 18:01 ` Tony Lindgren
2014-05-19 18:32 ` Nishanth Menon
2014-05-19 18:48 ` Joachim Eastwood
2014-05-19 18:52 ` Nishanth Menon
2014-05-19 20:23 ` Tony Lindgren
2014-04-10 23:47 ` [PATCH 07/11] ARM: dts: Enable N900 keybaord sleep leds by default Tony Lindgren
2014-04-11 0:23 ` Tony Lindgren
2014-04-11 23:31 ` Aaro Koskinen
2014-04-23 21:07 ` Tony Lindgren
2014-04-10 23:47 ` [PATCH 08/11] ARM: dts: Fix omap serial wake-up when booted with device tree Tony Lindgren
2014-04-10 23:47 ` [PATCH 09/11] ARM: OMAP2+: Enable CPUidle in omap2plus_defconfig Tony Lindgren
2014-04-10 23:47 ` [PATCH 10/11] mfd: twl-core: Fix idle mode signaling for omaps when booted with device tree Tony Lindgren
2014-04-17 8:00 ` Lee Jones
2014-04-17 15:37 ` Tony Lindgren
2014-04-23 14:46 ` [GIT PULL] arm: omap: Immutable branch between MFD and ARM OMAP due for the v3.16 merge-window Lee Jones
2014-04-23 20:41 ` Tony Lindgren
2014-04-10 23:47 ` [PATCH 11/11] pinctrl: single: Clear pin interrupts enabled by bootloader Tony Lindgren
2014-04-22 11:54 ` Linus Walleij
2014-04-22 16:10 ` Tony Lindgren
2014-04-23 13:57 ` Linus Walleij
2014-04-11 20:47 ` [PATCH 00/11] Fixes for omap PM for making omap3 DT only Sebastian Reichel
2014-04-11 21:04 ` Tony Lindgren
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=20140415225559.GA5313@atomide.com \
--to=tony@atomide.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;
as well as URLs for NNTP newsgroup(s).