All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@ti.com>
To: Tony Lindgren <tony@atomide.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH 06/10] omap2+: Remove gptimer_wakekup for now
Date: Thu, 31 Mar 2011 15:09:45 -0700	[thread overview]
Message-ID: <87zkob6ixi.fsf@ti.com> (raw)
In-Reply-To: <20110328222142.4046.4677.stgit@baageli.muru.com> (Tony Lindgren's message of "Mon, 28 Mar 2011 15:21:43 -0700")

Tony Lindgren <tony@atomide.com> writes:

> This removes the support for setting the wake-up timer for debugging.
>
> Later on we can reserve gptimer1 for PM code only and have similar
> functionality.
>
> Signed-off-by: Tony Lindgren <tony@atomide.com>

While we work on an alternative, rather than completely remove this
functionality, below is a very small patch (replaces $SUBJECT patch)
that will keep the current wakeup-from-suspend timer for PM debug
working.

Note that GPT1 fs not just used for wakeups from suspend.  GPT1 needs to
also be the clockevent (at least during idle) so that next-timer
interrupts during idle are also programmed for GPT1.

Here is what I see as a possible "real" solution.  Let's see if we're on
the same page.

- GPT1 reserved for "special" PM wakeup
- GPT2 used as high-resolution clockevent (using sys_clk, but stops during idle)
- GPT3 (or counter_32k) used as clocksource depending on Kconfig

Whenever we're going idle (or suspend), we have to effectively switch
the clockevent from GPT2 to GPT1.  I assume this is what you have in
mind as well.

We'll need to dig into the clockevent (and tick broadcast) code to get
this to work on UP.  On SMP, the C3STOP flag is used to signify that at
clockevent will stop during specific power states, so an alternate
clockevent is used, but IIUC, this doesn't currently work the same on
UP.  I think Santosh has looked into this more recently than I have.
Santosh, if you have any recent status on this, could you share?  I'll
gladly work on the clockevent layer if necessary for this.

Tony, in the mean time, can you use something like the patch below
instead of $SUBJECT patch?  At least we won't loose functionality while
working on this feature.

Kevin


>From e7affbb60e292b507ee1259b6a47f1e30b7fc071 Mon Sep 17 00:00:00 2001
From: Kevin Hilman <khilman@ti.com>
Date: Thu, 31 Mar 2011 14:49:27 -0700
Subject: [PATCH] OMAP2+: PM debug: update suspend wakeup timer for DM timer changes

Signed-off-by: Kevin Hilman <khilman@ti.com>
---
 arch/arm/mach-omap2/pm-debug.c |    4 ++--
 arch/arm/mach-omap2/timer-gp.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index a5a83b3..eccf117 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -171,8 +171,8 @@ void omap2_pm_wakeup_on_timer(u32 seconds, u32 milliseconds)
 
 	tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer_wakeup));
 	cycles = tick_rate * seconds + tick_rate * milliseconds / 1000;
-	omap_dm_timer_stop(gptimer_wakeup);
-	omap_dm_timer_set_load_start(gptimer_wakeup, 0, 0xffffffff - cycles);
+	__omap_dm_timer_load_start(gptimer_wakeup->io_base, OMAP_TIMER_CTRL_ST,
+				   0xffffffff - cycles, 1);
 
 	pr_info("PM: Resume timer in %u.%03u secs"
 		" (%d ticks at %d ticks/sec.)\n",
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c
index c21e99f..52100b2 100644
--- a/arch/arm/mach-omap2/timer-gp.c
+++ b/arch/arm/mach-omap2/timer-gp.c
@@ -76,7 +76,7 @@ static struct omap_dm_timer *gptimer;
 static struct clock_event_device clockevent_gpt;
 static u8 __initdata gptimer_id = 1;
 static u8 __initdata inited;
-struct omap_dm_timer *gptimer_wakeup;
+struct omap_dm_timer *gptimer_wakeup = &clkev;
 
 static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id)
 {
-- 
1.7.4


WARNING: multiple messages have this Message-ID (diff)
From: khilman@ti.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 06/10] omap2+: Remove gptimer_wakekup for now
Date: Thu, 31 Mar 2011 15:09:45 -0700	[thread overview]
Message-ID: <87zkob6ixi.fsf@ti.com> (raw)
In-Reply-To: <20110328222142.4046.4677.stgit@baageli.muru.com> (Tony Lindgren's message of "Mon, 28 Mar 2011 15:21:43 -0700")

Tony Lindgren <tony@atomide.com> writes:

> This removes the support for setting the wake-up timer for debugging.
>
> Later on we can reserve gptimer1 for PM code only and have similar
> functionality.
>
> Signed-off-by: Tony Lindgren <tony@atomide.com>

While we work on an alternative, rather than completely remove this
functionality, below is a very small patch (replaces $SUBJECT patch)
that will keep the current wakeup-from-suspend timer for PM debug
working.

Note that GPT1 fs not just used for wakeups from suspend.  GPT1 needs to
also be the clockevent (at least during idle) so that next-timer
interrupts during idle are also programmed for GPT1.

Here is what I see as a possible "real" solution.  Let's see if we're on
the same page.

- GPT1 reserved for "special" PM wakeup
- GPT2 used as high-resolution clockevent (using sys_clk, but stops during idle)
- GPT3 (or counter_32k) used as clocksource depending on Kconfig

Whenever we're going idle (or suspend), we have to effectively switch
the clockevent from GPT2 to GPT1.  I assume this is what you have in
mind as well.

We'll need to dig into the clockevent (and tick broadcast) code to get
this to work on UP.  On SMP, the C3STOP flag is used to signify that at
clockevent will stop during specific power states, so an alternate
clockevent is used, but IIUC, this doesn't currently work the same on
UP.  I think Santosh has looked into this more recently than I have.
Santosh, if you have any recent status on this, could you share?  I'll
gladly work on the clockevent layer if necessary for this.

Tony, in the mean time, can you use something like the patch below
instead of $SUBJECT patch?  At least we won't loose functionality while
working on this feature.

Kevin

  reply	other threads:[~2011-03-31 22:09 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-28 22:21 [PATCH 00/10] omap init_early changes for irq and timer init Tony Lindgren
2011-03-28 22:21 ` Tony Lindgren
2011-03-28 22:21 ` [PATCH 01/10] omap: Use separate init_irq functions to avoid cpu_is_omap tests early Tony Lindgren
2011-03-28 22:21   ` Tony Lindgren
2011-03-29  6:11   ` [PATCH 01/10] omap: Use separate init_irq functions to avoidcpu_is_omap " Santosh Shilimkar
2011-03-29  6:11     ` Santosh Shilimkar
2011-03-29  6:11   ` Santosh Shilimkar
2011-03-29  6:11     ` Santosh Shilimkar
2011-03-29  6:11   ` Santosh Shilimkar
2011-03-29  6:11     ` Santosh Shilimkar
2011-03-29  6:11   ` Santosh Shilimkar
2011-03-29  6:11     ` Santosh Shilimkar
2011-03-29 15:30     ` Tony Lindgren
2011-03-29 15:30       ` Tony Lindgren
2011-03-29 22:27       ` Tony Lindgren
2011-03-29 22:27         ` Tony Lindgren
2011-03-29 17:11   ` [PATCH 01/10] omap: Use separate init_irq functions to avoid cpu_is_omap " Kevin Hilman
2011-03-29 17:11     ` Kevin Hilman
2011-03-29 17:14     ` Tony Lindgren
2011-03-29 17:14       ` Tony Lindgren
2011-05-17 11:28       ` Tony Lindgren
2011-05-17 11:28         ` Tony Lindgren
2011-03-28 22:21 ` [PATCH 02/10] omap: Set separate timer init functions to avoid cpu_is_omap tests Tony Lindgren
2011-03-28 22:21   ` Tony Lindgren
2011-03-28 22:21 ` [PATCH 03/10] omap: Move dmtimer defines to dmtimer.h Tony Lindgren
2011-03-28 22:21   ` Tony Lindgren
2011-03-29 17:41   ` Kevin Hilman
2011-03-29 17:41     ` Kevin Hilman
2011-03-29 17:44     ` Tony Lindgren
2011-03-29 17:44       ` Tony Lindgren
2011-03-28 22:21 ` [PATCH 04/10] omap: Make a subset of dmtimer functions into inline functions Tony Lindgren
2011-03-28 22:21   ` Tony Lindgren
2011-03-29 17:51   ` Kevin Hilman
2011-03-29 17:51     ` Kevin Hilman
2011-03-29 17:58     ` Tony Lindgren
2011-03-29 17:58       ` Tony Lindgren
2011-03-29 18:01       ` Kevin Hilman
2011-03-29 18:01         ` Kevin Hilman
2011-03-29 18:02         ` Tony Lindgren
2011-03-29 18:02           ` Tony Lindgren
2011-03-28 22:21 ` [PATCH 05/10] omap2+: Use dmtimer macros for clockevent Tony Lindgren
2011-03-28 22:21   ` Tony Lindgren
2011-03-29 17:16   ` Tony Lindgren
2011-03-29 17:16     ` Tony Lindgren
2011-03-31 21:35   ` Kevin Hilman
2011-03-31 21:35     ` Kevin Hilman
2011-03-31 22:04     ` Tony Lindgren
2011-03-31 22:04       ` Tony Lindgren
2011-03-28 22:21 ` [PATCH 06/10] omap2+: Remove gptimer_wakekup for now Tony Lindgren
2011-03-28 22:21   ` Tony Lindgren
2011-03-31 22:09   ` Kevin Hilman [this message]
2011-03-31 22:09     ` Kevin Hilman
2011-04-01 16:26     ` Santosh Shilimkar
2011-04-01 16:26       ` Santosh Shilimkar
2011-03-28 22:21 ` [PATCH 07/10] omap2+: Reserve clocksource and timesource and initialize dmtimer later Tony Lindgren
2011-03-28 22:21   ` Tony Lindgren
2011-03-28 22:21 ` [PATCH 08/10] omap2+: Use dmtimer macros for clocksource Tony Lindgren
2011-03-28 22:21   ` Tony Lindgren
2011-03-28 22:21 ` [PATCH 09/10] omap2+: Remove omap2_gp_clockevent_set_gptimer Tony Lindgren
2011-03-28 22:21   ` Tony Lindgren
2011-03-28 22:21 ` [PATCH 10/10] omap2+: Rename timer-gp.c into timer.c to combine timer init functions Tony Lindgren
2011-03-28 22:21   ` Tony Lindgren
2011-03-29 18:16 ` [PATCH 00/10] omap init_early changes for irq and timer init Kevin Hilman
2011-03-29 18:16   ` Kevin Hilman
2011-03-30  7:56 ` Santosh Shilimkar
2011-03-30  7:56   ` Santosh Shilimkar
2011-03-30 18:22   ` Tony Lindgren
2011-03-30 18:22     ` Tony Lindgren
2011-03-31  8:16     ` Santosh Shilimkar
2011-03-31  8:16       ` Santosh Shilimkar
2011-03-31 17:32       ` Tony Lindgren
2011-03-31 17:32         ` Tony Lindgren
2011-04-01  8:39         ` Santosh Shilimkar
2011-04-01  8:39           ` Santosh Shilimkar

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=87zkob6ixi.fsf@ti.com \
    --to=khilman@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.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.