All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tero Kristo <t-kristo@ti.com>
To: Jon Hunter <jon-hunter@ti.com>
Cc: linux-omap@vger.kernel.org, khilman@ti.com, paul@pwsan.com,
	Santosh Shilimkar <santosh.shilimkar@ti.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 08/19] ARM: OMAP4: PM: Add device-off support
Date: Wed, 25 Apr 2012 10:30:15 +0300	[thread overview]
Message-ID: <1335339015.2149.106.camel@sokoban> (raw)
In-Reply-To: <4F96E70C.4040008@ti.com>

On Tue, 2012-04-24 at 12:46 -0500, Jon Hunter wrote:
> Hi Tero,
> 
> On 04/20/2012 04:33 AM, Tero Kristo wrote:
> > This patch adds device off support to OMAP4 device type.
> > 
> > OFF mode is disabled by default, however, there are two ways to enable
> > OFF mode:
> > a) In the board file, call omap4_pm_off_mode_enable(1)
> > b) Enable OFF mode using the debugfs entry
> > echo "1">/sys/kernel/debug/pm_debug/enable_off_mode
> > (conversely echo '0' will disable it as well).
> > 
> > Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> > [t-kristo@ti.com: largely re-structured the code]
> > Signed-off-by: Tero Kristo <t-kristo@ti.com>
> > ---
> >  arch/arm/mach-omap2/omap-mpuss-lowpower.c |   24 ++++++++++-
> >  arch/arm/mach-omap2/omap-wakeupgen.c      |   47 +++++++++++++++++++-
> >  arch/arm/mach-omap2/pm-debug.c            |   17 +++++--
> >  arch/arm/mach-omap2/pm.h                  |   28 ++++++++++--
> >  arch/arm/mach-omap2/pm44xx.c              |   45 +++++++++++++++++++
> >  arch/arm/mach-omap2/prm44xx.c             |   66 +++++++++++++++++++++++++++++
> >  6 files changed, 214 insertions(+), 13 deletions(-)
> > 
> > diff --git a/arch/arm/mach-omap2/omap-mpuss-lowpower.c b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
> > index e02c082..b9a2cc7 100644
> > --- a/arch/arm/mach-omap2/omap-mpuss-lowpower.c
> > +++ b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
> > @@ -60,6 +60,7 @@
> >  #include "prcm44xx.h"
> >  #include "prm44xx.h"
> >  #include "prm-regbits-44xx.h"
> > +#include "cm44xx.h"
> >  
> >  #ifdef CONFIG_SMP
> >  
> > @@ -232,6 +233,7 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state)
> >  {
> >  	unsigned int save_state = 0;
> >  	unsigned int wakeup_cpu;
> > +	int ret;
> >  
> >  	if (omap_rev() == OMAP4430_REV_ES1_0)
> >  		return -ENXIO;
> > @@ -263,9 +265,21 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state)
> >  	 * In MPUSS OSWR or device OFF, interrupt controller  contest is lost.
> >  	 */
> >  	mpuss_clear_prev_logic_pwrst();
> > -	if ((pwrdm_read_next_pwrst(mpuss_pd) == PWRDM_POWER_RET) &&
> > -		(pwrdm_read_logic_retst(mpuss_pd) == PWRDM_POWER_OFF))
> > +	if (omap4_device_next_state_off()) {
> > +		/* Save the device context to SAR RAM */
> > +		ret = omap_sar_save();
> > +		if (ret)
> > +			return ret;
> 
> Is it safe to simply return here? I was not sure if we need to call
> pwrdm_post_transition, given that we have already called
> pwrdm_pre_transition on entry.

Hmm, thats a good point, I'll change the patch slightly. Anyway,
currently the potential solo pwrdm_pre_transition() will not break
anything, but in future it would, as we are planning to control AUTO_RET
feature through the pwrdm_pre / pwrdm_post calls.

-Tero


WARNING: multiple messages have this Message-ID (diff)
From: t-kristo@ti.com (Tero Kristo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 08/19] ARM: OMAP4: PM: Add device-off support
Date: Wed, 25 Apr 2012 10:30:15 +0300	[thread overview]
Message-ID: <1335339015.2149.106.camel@sokoban> (raw)
In-Reply-To: <4F96E70C.4040008@ti.com>

On Tue, 2012-04-24 at 12:46 -0500, Jon Hunter wrote:
> Hi Tero,
> 
> On 04/20/2012 04:33 AM, Tero Kristo wrote:
> > This patch adds device off support to OMAP4 device type.
> > 
> > OFF mode is disabled by default, however, there are two ways to enable
> > OFF mode:
> > a) In the board file, call omap4_pm_off_mode_enable(1)
> > b) Enable OFF mode using the debugfs entry
> > echo "1">/sys/kernel/debug/pm_debug/enable_off_mode
> > (conversely echo '0' will disable it as well).
> > 
> > Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> > [t-kristo at ti.com: largely re-structured the code]
> > Signed-off-by: Tero Kristo <t-kristo@ti.com>
> > ---
> >  arch/arm/mach-omap2/omap-mpuss-lowpower.c |   24 ++++++++++-
> >  arch/arm/mach-omap2/omap-wakeupgen.c      |   47 +++++++++++++++++++-
> >  arch/arm/mach-omap2/pm-debug.c            |   17 +++++--
> >  arch/arm/mach-omap2/pm.h                  |   28 ++++++++++--
> >  arch/arm/mach-omap2/pm44xx.c              |   45 +++++++++++++++++++
> >  arch/arm/mach-omap2/prm44xx.c             |   66 +++++++++++++++++++++++++++++
> >  6 files changed, 214 insertions(+), 13 deletions(-)
> > 
> > diff --git a/arch/arm/mach-omap2/omap-mpuss-lowpower.c b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
> > index e02c082..b9a2cc7 100644
> > --- a/arch/arm/mach-omap2/omap-mpuss-lowpower.c
> > +++ b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
> > @@ -60,6 +60,7 @@
> >  #include "prcm44xx.h"
> >  #include "prm44xx.h"
> >  #include "prm-regbits-44xx.h"
> > +#include "cm44xx.h"
> >  
> >  #ifdef CONFIG_SMP
> >  
> > @@ -232,6 +233,7 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state)
> >  {
> >  	unsigned int save_state = 0;
> >  	unsigned int wakeup_cpu;
> > +	int ret;
> >  
> >  	if (omap_rev() == OMAP4430_REV_ES1_0)
> >  		return -ENXIO;
> > @@ -263,9 +265,21 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state)
> >  	 * In MPUSS OSWR or device OFF, interrupt controller  contest is lost.
> >  	 */
> >  	mpuss_clear_prev_logic_pwrst();
> > -	if ((pwrdm_read_next_pwrst(mpuss_pd) == PWRDM_POWER_RET) &&
> > -		(pwrdm_read_logic_retst(mpuss_pd) == PWRDM_POWER_OFF))
> > +	if (omap4_device_next_state_off()) {
> > +		/* Save the device context to SAR RAM */
> > +		ret = omap_sar_save();
> > +		if (ret)
> > +			return ret;
> 
> Is it safe to simply return here? I was not sure if we need to call
> pwrdm_post_transition, given that we have already called
> pwrdm_pre_transition on entry.

Hmm, thats a good point, I'll change the patch slightly. Anyway,
currently the potential solo pwrdm_pre_transition() will not break
anything, but in future it would, as we are planning to control AUTO_RET
feature through the pwrdm_pre / pwrdm_post calls.

-Tero

  reply	other threads:[~2012-04-25  7:30 UTC|newest]

Thread overview: 126+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-20  9:33 [PATCH 00/19] ARM: OMAP4 device off support Tero Kristo
2012-04-20  9:33 ` Tero Kristo
2012-04-20  9:33 ` [PATCH 01/19] ARM: OMAP4: PM: save/restore all DPLL settings in OFF mode Tero Kristo
2012-04-20  9:33   ` Tero Kristo
2012-04-23 16:09   ` Jon Hunter
2012-04-23 16:09     ` Jon Hunter
2012-04-25  7:33     ` Tero Kristo
2012-04-25  7:33       ` Tero Kristo
2012-04-25 15:12       ` Jon Hunter
2012-04-25 15:12         ` Jon Hunter
2012-05-04 19:22         ` Tony Lindgren
2012-05-04 19:22           ` Tony Lindgren
2012-05-02 10:10   ` Bedia, Vaibhav
2012-05-02 10:10     ` Bedia, Vaibhav
2012-05-02 10:18     ` Shilimkar, Santosh
2012-05-02 10:18       ` Shilimkar, Santosh
2012-05-02 10:55       ` Bedia, Vaibhav
2012-05-02 10:55         ` Bedia, Vaibhav
2012-05-02 11:00         ` Shilimkar, Santosh
2012-05-02 11:00           ` Shilimkar, Santosh
2012-05-02 11:40           ` Bedia, Vaibhav
2012-05-02 11:40             ` Bedia, Vaibhav
2012-05-02 11:46             ` Shilimkar, Santosh
2012-05-02 11:46               ` Shilimkar, Santosh
2012-05-02 11:55               ` Bedia, Vaibhav
2012-05-02 11:55                 ` Bedia, Vaibhav
2012-05-02 11:47             ` Menon, Nishanth
2012-05-02 11:47               ` Menon, Nishanth
2012-05-02 11:55               ` Bedia, Vaibhav
2012-05-02 11:55                 ` Bedia, Vaibhav
2012-05-02 11:58                 ` Shilimkar, Santosh
2012-05-02 11:58                   ` Shilimkar, Santosh
2012-05-02 12:10                   ` Bedia, Vaibhav
2012-05-02 12:10                     ` Bedia, Vaibhav
2012-04-20  9:33 ` [PATCH 02/19] ARM: OMAP4: PM: save/restore all CM1/2 " Tero Kristo
2012-04-20  9:33   ` Tero Kristo
2012-05-09 23:27   ` Kevin Hilman
2012-05-09 23:27     ` Kevin Hilman
2012-05-11 14:30     ` Tero Kristo
2012-05-11 14:30       ` Tero Kristo
2012-04-20  9:33 ` [PATCH 03/19] ARM: OMAP4: PM: powerdomain: Add HWSAR flag to L3INIT Tero Kristo
2012-04-20  9:33   ` Tero Kristo
2012-04-20  9:33 ` [PATCH 04/19] ARM: OMAP4: Add SAR ROM base address Tero Kristo
2012-04-20  9:33   ` Tero Kristo
2012-04-20  9:33 ` [PATCH 05/19] ARM: OMAP4: PM: Add SAR backup support towards device OFF Tero Kristo
2012-04-20  9:33   ` Tero Kristo
2012-04-24 16:35   ` Tony Lindgren
2012-04-24 16:35     ` Tony Lindgren
2012-04-25  7:18     ` Tero Kristo
2012-04-25  7:18       ` Tero Kristo
2012-04-20  9:33 ` [PATCH 06/19] ARM: OMAP4: Auto generate SAR layout contents Tero Kristo
2012-04-20  9:33   ` Tero Kristo
2012-04-24 16:37   ` Tony Lindgren
2012-04-24 16:37     ` Tony Lindgren
2012-04-20  9:33 ` [PATCH 07/19] ARM: OMAP4: SAR: generate overwrite data based on SAR ROM contents Tero Kristo
2012-04-20  9:33   ` Tero Kristo
2012-04-20  9:33 ` [PATCH 08/19] ARM: OMAP4: PM: Add device-off support Tero Kristo
2012-04-20  9:33   ` Tero Kristo
2012-04-24 17:46   ` Jon Hunter
2012-04-24 17:46     ` Jon Hunter
2012-04-25  7:30     ` Tero Kristo [this message]
2012-04-25  7:30       ` Tero Kristo
2012-04-20  9:33 ` [PATCH 09/19] ARM: OMAP4: PM: add errata support Tero Kristo
2012-04-20  9:33   ` Tero Kristo
2012-04-20  9:33 ` [PATCH 10/19] ARM: OMAP4: PM: Work-around for ROM code BUG of IVAHD/TESLA Tero Kristo
2012-04-20  9:33   ` Tero Kristo
2012-04-24 17:50   ` Jon Hunter
2012-04-24 17:50     ` Jon Hunter
2012-04-25  7:31     ` Tero Kristo
2012-04-25  7:31       ` Tero Kristo
2012-04-20  9:33 ` [PATCH 11/19] ARM: OMAP4: PM: save/restore CM L3INSTR registers when MPU hits OSWR/OFF mode Tero Kristo
2012-04-20  9:33   ` Tero Kristo
2012-04-24 17:57   ` Jon Hunter
2012-04-24 17:57     ` Jon Hunter
2012-04-25  7:31     ` Tero Kristo
2012-04-25  7:31       ` Tero Kristo
2012-04-20  9:33 ` [PATCH 12/19] ARM: OMAP4: PM: update ROM return address for OSWR and OFF Tero Kristo
2012-04-20  9:33   ` Tero Kristo
2012-04-24 16:39   ` Tony Lindgren
2012-04-24 16:39     ` Tony Lindgren
2012-04-25  7:24     ` Tero Kristo
2012-04-25  7:24       ` Tero Kristo
2012-04-20  9:33 ` [PATCH 13/19] ARM: OMAP4: PM: Mark the PPI and SPI interrupts as non-secure for GP Tero Kristo
2012-04-20  9:33   ` Tero Kristo
2012-04-20  9:33 ` [PATCH 14/19] ARM: OMAP4: wakeupgen: enable clocks for save_secure_all Tero Kristo
2012-04-20  9:33   ` Tero Kristo
2012-04-20  9:33 ` [PATCH 15/19] ARM: OMAP4430: PM: workaround for DDR corruption on second CS Tero Kristo
2012-04-20  9:33   ` Tero Kristo
2012-04-24 18:22   ` Jon Hunter
2012-04-24 18:22     ` Jon Hunter
2012-04-25  7:26     ` Tero Kristo
2012-04-25  7:26       ` Tero Kristo
2012-04-25  7:59       ` Shilimkar, Santosh
2012-04-25  7:59         ` Shilimkar, Santosh
2012-04-25 15:16       ` Jon Hunter
2012-04-25 15:16         ` Jon Hunter
2012-04-26  6:19         ` Shilimkar, Santosh
2012-04-26  6:19           ` Shilimkar, Santosh
2012-04-20  9:33 ` [PATCH 16/19] TEMP: ARM: OMAP4: prevent voltage transitions Tero Kristo
2012-04-20  9:33   ` Tero Kristo
2012-04-20  9:33 ` [PATCH 17/19] ARM: OMAP4: put cpu1 back to sleep if no wake request Tero Kristo
2012-04-20  9:33   ` Tero Kristo
2012-04-20  9:33 ` [PATCH 18/19] ARM: OMAP4460: wakeupgen: set GIC_CPU0 backup status flag always Tero Kristo
2012-04-20  9:33   ` Tero Kristo
2012-04-20  9:33 ` [PATCH 19/19] ARM: OMAP4: powerdomain: update mpu / core off counters during device off Tero Kristo
2012-04-20  9:33   ` Tero Kristo
2012-04-20 12:20 ` [PATCH 00/19] ARM: OMAP4 device off support T Krishnamoorthy, Balaji
2012-04-20 12:20   ` T Krishnamoorthy, Balaji
2012-04-20 12:58   ` Tero Kristo
2012-04-20 12:58     ` Tero Kristo
2012-04-20 13:55     ` Kevin Hilman
2012-04-20 13:55       ` Kevin Hilman
2012-04-20 14:43       ` Tero Kristo
2012-04-20 14:43         ` Tero Kristo
2012-04-20 14:51         ` Datta, Shubhrajyoti
2012-04-20 14:51           ` Datta, Shubhrajyoti
2012-04-20 15:07           ` Tero Kristo
2012-04-20 15:07             ` Tero Kristo
2012-04-23  6:28             ` Shubhrajyoti Datta
2012-04-23  6:28               ` Shubhrajyoti Datta
2012-05-09 22:46 ` Kevin Hilman
2012-05-09 22:46   ` Kevin Hilman
2012-05-09 23:14   ` Russell King - ARM Linux
2012-05-09 23:14     ` Russell King - ARM Linux
2012-05-10  9:47     ` Tero Kristo
2012-05-10  9:47       ` 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=1335339015.2149.106.camel@sokoban \
    --to=t-kristo@ti.com \
    --cc=jon-hunter@ti.com \
    --cc=khilman@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=santosh.shilimkar@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 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.