Skip to contentSkip to conversation

Bringing back gptimer_wakeup

DISCUSSION Tasslehoff Kjappfot 3 participants 6 messages Jun 18, 2012 – Jun 28, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

The support for using a timer to wake from suspend was removed in:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=98e182a26bbbf5575457622337684ef61493e864

I found an alternative patch (http://www.mail-archive.com/[email protected]/msg47836.html) that claimed to keep it working using GPTIMER1 instead, but I haven't been able to make it work (likely because the timer code has changed a good deal since the patch was posted).

Anyone got
a) a patch that enables this feature on newer kernels, or
b) an idea how the patch above can be made to work?

Regards,
Tasslehoff

#1 lore raw
Quoted 9 lines · Tasslehoff Kjappfot

The support for using a timer to wake from suspend was removed in:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=98e182a26bbbf5575457622337684ef61493e864

I found an alternative patch
(http://www.mail-archive.com/[email protected]/msg47836.html) that claimed to keep it working using GPTIMER1 instead, but I haven't been able to make it work (likely because the timer code has changed a good deal since the patch was posted).

Quoted 4 lines

Anyone got
a) a patch that enables this feature on newer kernels, or
b) an idea how the patch above can be made to work?

I had one working against 3.4. may be you can try this out and see it helps.

Regards
Santosh

---
 arch/arm/mach-omap2/pm-debug.c |    5 +++++
 arch/arm/mach-omap2/timer.c    |   12 ++++++++++++
 2 files changed, 17 insertions(+)
arch/arm/mach-omap2/pm-debug.c +5 -0
index 814bcd9..8f59a70 100644
@@ -39,6 +39,7 @@
 #include "pm.h"
 
 u32 enable_off_mode;
+u32 wakeup_timer_seconds = 0;
 
 #ifdef CONFIG_DEBUG_FS
 #include <linux/debugfs.h>
@@ -276,6 +277,10 @@ static int __init pm_dbg_init(void)
 
 	(void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUSR, d,
 				   &enable_off_mode, &pm_dbg_option_fops);
+
+	(void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUSR, d,
+				   &wakeup_timer_seconds, &pm_dbg_option_fops);
+
 	pm_dbg_init_done = 1;
 
 	return 0;
arch/arm/mach-omap2/timer.c +3 -0
index b28ea5e..31a0628 100644
@@ -82,6 +82,9 @@
 #define MAX_GPTIMER_ID		12
 
 static u32 sys_timer_reserved;
+#ifdef CONFIG_PM_DEBUG
+extern u32	wakeup_timer_seconds;
+#endif
 
 /* Clockevent code */
 
@@ -138,6 +141,15 @@ static void omap2_gp_timer_set_mode(enum

clock_event_mode mode,
break;
case CLOCK_EVT_MODE_UNUSED:
case CLOCK_EVT_MODE_SHUTDOWN:
+#ifdef CONFIG_PM_DEBUG
+ if (wakeup_timer_seconds) {
+ __omap_dm_timer_write(&clkev, OMAP_TIMER_LOAD_REG,
+ 0xffffffff - (clkev.rate * wakeup_timer_seconds), 1);
+ __omap_dm_timer_load_start(&clkev, OMAP_TIMER_CTRL_ST,
+ 0xffffffff - (clkev.rate * wakeup_timer_seconds), 1);
+ }
+#endif
+ break;
case CLOCK_EVT_MODE_RESUME:
break;
}

Signature · 1 line
1.7.9.5
#2 lore raw
In reply to Tasslehoff Kjappfot
Quoted 9 lines · Tasslehoff Kjappfot

The support for using a timer to wake from suspend was removed in:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=98e182a26bbbf5575457622337684ef61493e864

I found an alternative patch
(http://www.mail-archive.com/[email protected]/msg47836.html)
that claimed to keep it working using GPTIMER1 instead, but I haven't been able to make it work (likely because the timer code has changed a good deal since the patch was posted).

Quoted 3 lines

Anyone got
a) a patch that enables this feature on newer kernels, or
b) an idea how the patch above can be made to work?

The branch below (based on v3.4) will work (at least on OMAP3)

We've been holding off on putting this back becasue the timer interface has been going through some major cleanup/rework, but I would like to see this make it back in soonish.

Kevin

git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git pm-wip/wakeup-timer

#3 lore raw
Quoted 15 lines · Kevin Hilman
Quoted 9 lines · Tasslehoff Kjappfot

The support for using a timer to wake from suspend was removed in:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=98e182a26bbbf5575457622337684ef61493e864

I found an alternative patch
(http://www.mail-archive.com/[email protected]/msg47836.html)
that claimed to keep it working using GPTIMER1 instead, but I haven't been able to make it work (likely because the timer code has changed a good deal since the patch was posted).

Quoted 3 lines

Anyone got
a) a patch that enables this feature on newer kernels, or
b) an idea how the patch above can be made to work?

Quoted 6 lines

The branch below (based on v3.4) will work (at least on OMAP3)

We've been holding off on putting this back becasue the timer interface has been going through some major cleanup/rework, but I would like to see this make it back in soonish.

I got an off-list message from Tasslehoff, that the patch I sent worked for him.

Regards
Santosh

#4 lore raw
Quoted 18 lines · Santosh
Quoted 17 lines · Kevin Hilman
Quoted 9 lines · Tasslehoff Kjappfot

The support for using a timer to wake from suspend was removed in:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=98e182a26bbbf5575457622337684ef61493e864

I found an alternative patch
(http://www.mail-archive.com/[email protected]/msg47836.html)
that claimed to keep it working using GPTIMER1 instead, but I haven't been able to make it work (likely because the timer code has changed a good deal since the patch was posted).

Quoted 3 lines

Anyone got
a) a patch that enables this feature on newer kernels, or
b) an idea how the patch above can be made to work?

The branch below (based on v3.4) will work (at least on OMAP3)

Quoted 8 lines
Quoted 4 lines

We've been holding off on putting this back becasue the timer interface has been going through some major cleanup/rework, but I would like to see this make it back in soonish.

I got an off-list message from Tasslehoff, that the patch I sent worked for him.

Regards
Santosh

Ah, that was meant to be an on-list message. Santosh' fix worked well on my 3.2.18 kernel.

- Tasslehoff

#5 lore raw
In reply to Kevin Hilman
Quoted 15 lines · Kevin Hilman
Quoted 9 lines · Tasslehoff Kjappfot

The support for using a timer to wake from suspend was removed in:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=98e182a26bbbf5575457622337684ef61493e864

I found an alternative patch
(http://www.mail-archive.com/[email protected]/msg47836.html)
that claimed to keep it working using GPTIMER1 instead, but I haven't been able to make it work (likely because the timer code has changed a good deal since the patch was posted).

Quoted 3 lines

Anyone got
a) a patch that enables this feature on newer kernels, or
b) an idea how the patch above can be made to work?

Quoted 5 lines

The branch below (based on v3.4) will work (at least on OMAP3)

We've been holding off on putting this back becasue the timer interface has been going through some major cleanup/rework, but I would like to see this make it back in soonish.

Note that another feature that can be used for this same feature is wakeup using RTC.

On OMAP3 platoforms with TWL4030 PMIC (which contains an RTC), this is successfully working using the 'rtcwake' utility.

E.g., to suspend-to-RAM and trigger an RTC wakeup 4 seconds later, do:

  # rtcwake -m mem -s 4

The RTC timekeeping seems a bit broken and the actual delay seems to be about 2x the value passed in here, but otherwise this works.

There are currently some problems with the OMAP4 RTC driver that prevent this from working, but they need to be investigated.

Kevin