All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@ti.com>
To: "Mark A. Greer" <mgreer@animalcreek.com>
Cc: Paul Walmsley <paul@pwsan.com>,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 03/12] arm: omap3: Only sleep in cpuidle driver if I/O wake-ups work
Date: Fri, 27 Apr 2012 14:12:12 -0700	[thread overview]
Message-ID: <87haw4282b.fsf@ti.com> (raw)
In-Reply-To: <20120424232506.GA8850@animalcreek.com> (Mark A. Greer's message of "Tue, 24 Apr 2012 16:25:06 -0700")

"Mark A. Greer" <mgreer@animalcreek.com> writes:

> On Tue, Apr 24, 2012 at 01:51:05PM -0700, Mark A. Greer wrote:
>> On Wed, Apr 11, 2012 at 03:37:47PM -0600, Paul Walmsley wrote:
>> > Hi
>> 
>> Hi Paul, Kevin.
>> 
>> > On Wed, 11 Apr 2012, Mark A. Greer wrote:
>> > 
>> > > From: "Mark A. Greer" <mgreer@animalcreek.com>
>> > > 
>> > > Currently, the OMAP3 cpuidle driver calls omap3_enter_idle()
>> > > which calls omap_sram_idle().  omap_sram_idle() eventually
>> > > causes a 'wfi' instruction to be executed effectively putting
>> > > the system to sleep.  It is assumed that an I/O wake-up event
>> > > will occur to wake the system up again.  This doesn't work on
>> > > systems that don't support I/O wake-ups (indicated by
>> > > omap3_has_io_wakeup() returning false).
>> > > 
>> > > To handle this, follow the same path in omap3_enter_idle()
>> > > that would be followed if an interrupt were pending.
>> > 
>> > I don't quite understand this patch.  Are you saying that AM3517/3505 
>> > can't wake from WFI?  That would seem odd.
>> > 
>> > There are other sources of wakeup on the system other than I/O wakeup.  
>> > I/O wakeup only applies to wakeups from the I/O pads when the chip is in 
>> > RETENTION or OFF.  And as I understand it, neither of those apply to 
>> > AM3517/3505?
>> > 
>> > Even if I/O wakeups aren't supported, many of the IP blocks on the system 
>> > should be able to cause the ARM to exit WFI by asserting their 
>> > SWAKEUP lines and raising their interrupt lines.
>> 
>> I have changed the code to keep everything in the ON state and use
>> cpu_do_idle()--basically a wfi, cpu_v7_do_idle() in this case--and everything
>> works well (except networking, see below) when using an mmc-based rootfs.
>> 
>> The issue is with the emac--it can't wake the system up unless there
>> is an irq from the PHY to a wakeup-enabled GPIO (confirmed by h/w engr).
>> So, when using networking or using an nfs-based rootfs, there are all
>> kinds of timeouts, etc.  Basically, doing a wfi (i.e., pm_idle or cpuidle)
>> and expecting the emac to wake the system back up won't work.
>> 
>> How would you like me to proceed (to avoid the wfi in pm_idle & cpuidle)?
>
> Just thinking out loud...
>
> We could chose whether pm_idle & cpuidle issue a wfi based on
> whether there is a davinci-emac present.  The issue with that is
> that someday there may be another SoC that has a davinci-emac that
> can wake up the system.  I know cpu_is_xxx() is frowned upon but
> this does seem like a proper usage of it--the deciding factor
> really is whether its an am35x or not (and CONFIG_TI_DAVINCI_EMAC
> is enabled).

The presence of the davinci_emac is probably overkill, avoiding WFI
should really only be done when the davinci_emac is *active*.
e.g. using an am35x with an EMAC *present*, but not in use because
there's an MMC rootfs for example.

If there's a good way to detect an in-use davinci_emac, then
disable_hlt() can be used to avoid WFI.  When the davinci_emac is not in
use (e.g. module unloaded etc.) then enable_hlt() can be used to
(re)allow WFI.

Kevin



WARNING: multiple messages have this Message-ID (diff)
From: khilman@ti.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/12] arm: omap3: Only sleep in cpuidle driver if I/O wake-ups work
Date: Fri, 27 Apr 2012 14:12:12 -0700	[thread overview]
Message-ID: <87haw4282b.fsf@ti.com> (raw)
In-Reply-To: <20120424232506.GA8850@animalcreek.com> (Mark A. Greer's message of "Tue, 24 Apr 2012 16:25:06 -0700")

"Mark A. Greer" <mgreer@animalcreek.com> writes:

> On Tue, Apr 24, 2012 at 01:51:05PM -0700, Mark A. Greer wrote:
>> On Wed, Apr 11, 2012 at 03:37:47PM -0600, Paul Walmsley wrote:
>> > Hi
>> 
>> Hi Paul, Kevin.
>> 
>> > On Wed, 11 Apr 2012, Mark A. Greer wrote:
>> > 
>> > > From: "Mark A. Greer" <mgreer@animalcreek.com>
>> > > 
>> > > Currently, the OMAP3 cpuidle driver calls omap3_enter_idle()
>> > > which calls omap_sram_idle().  omap_sram_idle() eventually
>> > > causes a 'wfi' instruction to be executed effectively putting
>> > > the system to sleep.  It is assumed that an I/O wake-up event
>> > > will occur to wake the system up again.  This doesn't work on
>> > > systems that don't support I/O wake-ups (indicated by
>> > > omap3_has_io_wakeup() returning false).
>> > > 
>> > > To handle this, follow the same path in omap3_enter_idle()
>> > > that would be followed if an interrupt were pending.
>> > 
>> > I don't quite understand this patch.  Are you saying that AM3517/3505 
>> > can't wake from WFI?  That would seem odd.
>> > 
>> > There are other sources of wakeup on the system other than I/O wakeup.  
>> > I/O wakeup only applies to wakeups from the I/O pads when the chip is in 
>> > RETENTION or OFF.  And as I understand it, neither of those apply to 
>> > AM3517/3505?
>> > 
>> > Even if I/O wakeups aren't supported, many of the IP blocks on the system 
>> > should be able to cause the ARM to exit WFI by asserting their 
>> > SWAKEUP lines and raising their interrupt lines.
>> 
>> I have changed the code to keep everything in the ON state and use
>> cpu_do_idle()--basically a wfi, cpu_v7_do_idle() in this case--and everything
>> works well (except networking, see below) when using an mmc-based rootfs.
>> 
>> The issue is with the emac--it can't wake the system up unless there
>> is an irq from the PHY to a wakeup-enabled GPIO (confirmed by h/w engr).
>> So, when using networking or using an nfs-based rootfs, there are all
>> kinds of timeouts, etc.  Basically, doing a wfi (i.e., pm_idle or cpuidle)
>> and expecting the emac to wake the system back up won't work.
>> 
>> How would you like me to proceed (to avoid the wfi in pm_idle & cpuidle)?
>
> Just thinking out loud...
>
> We could chose whether pm_idle & cpuidle issue a wfi based on
> whether there is a davinci-emac present.  The issue with that is
> that someday there may be another SoC that has a davinci-emac that
> can wake up the system.  I know cpu_is_xxx() is frowned upon but
> this does seem like a proper usage of it--the deciding factor
> really is whether its an am35x or not (and CONFIG_TI_DAVINCI_EMAC
> is enabled).

The presence of the davinci_emac is probably overkill, avoiding WFI
should really only be done when the davinci_emac is *active*.
e.g. using an am35x with an EMAC *present*, but not in use because
there's an MMC rootfs for example.

If there's a good way to detect an in-use davinci_emac, then
disable_hlt() can be used to avoid WFI.  When the davinci_emac is not in
use (e.g. module unloaded etc.) then enable_hlt() can be used to
(re)allow WFI.

Kevin

  reply	other threads:[~2012-04-27 21:12 UTC|newest]

Thread overview: 126+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-11 19:05 arm: omap3: am35x: Powerdomain, EMIF4, etc. fixups Mark A. Greer
2012-04-11 19:05 ` Mark A. Greer
2012-04-11 19:05 ` [PATCH 01/12] arm: omap3: Only access IVA if one exists Mark A. Greer
2012-04-11 19:05   ` Mark A. Greer
2012-04-11 19:05 ` [PATCH 02/12] arm: omap3: Only sleep during cpu_idle if I/O wake-ups work Mark A. Greer
2012-04-11 19:05   ` Mark A. Greer
2012-04-11 21:38   ` Paul Walmsley
2012-04-11 21:38     ` Paul Walmsley
2012-04-11 23:42   ` Jon Hunter
2012-04-11 23:42     ` Jon Hunter
2012-04-13  0:13     ` Mark A. Greer
2012-04-13  0:13       ` Mark A. Greer
2012-04-11 19:05 ` [PATCH 03/12] arm: omap3: Only sleep in cpuidle driver " Mark A. Greer
2012-04-11 19:05   ` Mark A. Greer
2012-04-11 21:37   ` Paul Walmsley
2012-04-11 21:37     ` Paul Walmsley
2012-04-11 22:23     ` Mark A. Greer
2012-04-11 22:23       ` Mark A. Greer
2012-04-11 22:47       ` Paul Walmsley
2012-04-11 22:47         ` Paul Walmsley
2012-04-11 23:08         ` Mark A. Greer
2012-04-11 23:08           ` Mark A. Greer
2012-04-24 20:51     ` Mark A. Greer
2012-04-24 20:51       ` Mark A. Greer
2012-04-24 23:25       ` Mark A. Greer
2012-04-24 23:25         ` Mark A. Greer
2012-04-27 21:12         ` Kevin Hilman [this message]
2012-04-27 21:12           ` Kevin Hilman
2012-04-27 21:55           ` Mark A. Greer
2012-04-27 21:55             ` Mark A. Greer
2012-04-30 21:34           ` Mark A. Greer
2012-04-30 21:34             ` Mark A. Greer
2012-04-30 22:00             ` Kevin Hilman
2012-04-30 22:00               ` Kevin Hilman
2012-04-30 22:18               ` Mark A. Greer
2012-04-30 22:18                 ` Mark A. Greer
2012-04-11 19:05 ` [PATCH 04/12] arm: omap3: am35x: Don't mark missing features as present Mark A. Greer
2012-04-11 19:05   ` Mark A. Greer
2012-04-11 19:05 ` [PATCH 05/12] arm: omap3: am35x: Add PWROFF feature Mark A. Greer
2012-04-11 19:05   ` Mark A. Greer
2012-04-11 22:46   ` Kevin Hilman
2012-04-11 22:46     ` Kevin Hilman
2012-04-11 23:11     ` Mark A. Greer
2012-04-11 23:11       ` Mark A. Greer
2012-04-24  4:36     ` Mark A. Greer
2012-04-24  4:36       ` Mark A. Greer
2012-04-27 21:07       ` Kevin Hilman
2012-04-27 21:07         ` Kevin Hilman
2012-04-30 22:08         ` Mark A. Greer
2012-04-30 22:08           ` Mark A. Greer
2012-04-11 19:05 ` [PATCH 06/12] arm: omap3: am35x: Add full PWRDM_POWER_INACTIVE support Mark A. Greer
2012-04-11 19:05   ` Mark A. Greer
2012-04-11 20:56   ` Jean Pihet
2012-04-11 20:56     ` Jean Pihet
2012-04-11 21:08     ` Paul Walmsley
2012-04-11 21:08       ` Paul Walmsley
2012-04-11 21:14       ` Mark A. Greer
2012-04-11 21:14         ` Mark A. Greer
2012-04-11 21:15         ` Jean Pihet
2012-04-11 21:15           ` Jean Pihet
2012-04-11 21:12     ` Mark A. Greer
2012-04-11 21:12       ` Mark A. Greer
2012-04-11 22:17   ` Paul Walmsley
2012-04-11 22:17     ` Paul Walmsley
2012-04-11 19:05 ` [PATCH 07/12] arm: omap3: am35x: Set proper powerdomain states Mark A. Greer
2012-04-11 19:05   ` Mark A. Greer
2012-04-11 21:53   ` Paul Walmsley
2012-04-11 21:53     ` Paul Walmsley
2012-04-11 22:40     ` Mark A. Greer
2012-04-11 22:40       ` Mark A. Greer
2012-04-12  0:24       ` Jon Hunter
2012-04-12  0:24         ` Jon Hunter
2012-04-12  2:19         ` Mark A. Greer
2012-04-12  2:19           ` Mark A. Greer
2012-04-11 19:05 ` [PATCH 08/12] arm: omap3: am35x: Fix clockdomain dependencies Mark A. Greer
2012-04-11 19:05   ` Mark A. Greer
2012-04-11 21:44   ` Paul Walmsley
2012-04-11 21:44     ` Paul Walmsley
2012-04-11 21:55     ` Mark A. Greer
2012-04-11 21:55       ` Mark A. Greer
2012-04-11 22:04       ` Paul Walmsley
2012-04-11 22:04         ` Paul Walmsley
2012-04-11 22:49         ` Mark A. Greer
2012-04-11 22:49           ` Mark A. Greer
2012-04-11 23:49           ` Paul Walmsley
2012-04-11 23:49             ` Paul Walmsley
2012-04-12  2:23             ` Mark A. Greer
2012-04-12  2:23               ` Mark A. Greer
2012-04-12  2:29               ` Paul Walmsley
2012-04-12  2:29                 ` Paul Walmsley
2012-04-12 23:00                 ` Mark A. Greer
2012-04-12 23:00                   ` Mark A. Greer
2012-04-11 19:05 ` [PATCH 09/12] arm: omap3: am35x: Add SDRC EMIF4 feature Mark A. Greer
2012-04-11 19:05   ` Mark A. Greer
2012-04-11 21:29   ` Paul Walmsley
2012-04-11 21:29     ` Paul Walmsley
2012-04-11 22:50     ` Mark A. Greer
2012-04-11 22:50       ` Mark A. Greer
2012-04-11 22:56   ` Paul Walmsley
2012-04-11 22:56     ` Paul Walmsley
2012-04-11 23:23     ` Mark A. Greer
2012-04-11 23:23       ` Mark A. Greer
2012-04-11 19:05 ` [PATCH 10/12] arm: omap3: am35x: Add minimal EMIF4 support Mark A. Greer
2012-04-11 19:05   ` Mark A. Greer
2012-04-11 21:31   ` Paul Walmsley
2012-04-11 21:31     ` Paul Walmsley
2012-04-11 23:22     ` Mark A. Greer
2012-04-11 23:22       ` Mark A. Greer
2012-04-11 19:05 ` [PATCH 11/12] arm: omap3: am35x: Add do_wfi routine for EMIF4 submodules Mark A. Greer
2012-04-11 19:05   ` Mark A. Greer
2012-04-11 22:35   ` Kevin Hilman
2012-04-11 22:35     ` Kevin Hilman
2012-04-11 23:26     ` Mark A. Greer
2012-04-11 23:26       ` Mark A. Greer
2012-04-11 22:36   ` Paul Walmsley
2012-04-11 22:36     ` Paul Walmsley
2012-04-13  0:12     ` Mark A. Greer
2012-04-13  0:12       ` Mark A. Greer
2012-04-11 22:54   ` Paul Walmsley
2012-04-11 22:54     ` Paul Walmsley
2012-04-11 19:05 ` [PATCH 12/12] arm: omap3: am35x: Register davinci_mdio before davinci_emac Mark A. Greer
2012-04-11 19:05   ` Mark A. Greer
2012-04-11 21:24   ` Paul Walmsley
2012-04-11 21:24     ` Paul Walmsley
2012-04-11 22:00     ` Mark A. Greer
2012-04-11 22:00       ` Mark A. Greer

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=87haw4282b.fsf@ti.com \
    --to=khilman@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mgreer@animalcreek.com \
    --cc=paul@pwsan.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.