[patch 2.6.26-rc4-git] PM: boot time suspend selftest - Kernel
This is a discussion on [patch 2.6.26-rc4-git] PM: boot time suspend selftest - Kernel ; Address some of Andrew's comments on the patch now in
MMOTM with name "pm-boot-time-suspend-selftest.patch".
Signed-off-by: David Brownell
---
kernel/power/main.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
--- a/kernel/power/main.c 2008-07-06 21:06:35.000000000 -0700
+++ b/kernel/power/main.c 2008-07-06 21:06:35.000000000 -0700
@@ ...
-
Re: [patch 2.6.26-rc4-git] PM: boot time suspend selftest
Address some of Andrew's comments on the patch now in
MMOTM with name "pm-boot-time-suspend-selftest.patch".
Signed-off-by: David Brownell
---
kernel/power/main.c | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
--- a/kernel/power/main.c 2008-07-06 21:06:35.000000000 -0700
+++ b/kernel/power/main.c 2008-07-06 21:06:35.000000000 -0700
@@ -160,10 +160,19 @@ static void suspend_test_finish(const ch
long nj = jiffies - suspend_test_start_time;
unsigned msec;
- msec = jiffies_to_msecs((nj >= 0) ? nj : -nj);
+ msec = jiffies_to_msecs(abs(nj));
pr_info("PM: %s took %d.%03d seconds\n", label,
msec / 1000, msec % 1000);
- WARN_ON_ONCE(msec > (TEST_SUSPEND_SECONDS * 1000));
+
+ /* Warning on suspend means the RTC alarm period needs to be
+ * larger -- the system was sooo slooowwww to suspend that the
+ * alarm (should have) fired before the system went to sleep!
+ *
+ * Warning on either suspend or resume also means the system
+ * has some performance issues. The stack dump of a WARN_ON
+ * is more likely to get the right attention than a printk...
+ */
+ WARN_ON(msec > (TEST_SUSPEND_SECONDS * 1000));
}
#else
@@ -579,13 +588,13 @@ core_initcall(pm_init);
static void __init test_wakealarm(struct rtc_device *rtc, suspend_state_t state)
{
- static char err_readtime [] __initdata =
+ static char err_readtime[] __initdata =
KERN_ERR "PM: can't read %s time, err %d\n";
- static char err_wakealarm [] __initdata =
+ static char err_wakealarm [] __initdata =
KERN_ERR "PM: can't set %s wakealarm, err %d\n";
- static char err_suspend [] __initdata =
+ static char err_suspend[] __initdata =
KERN_ERR "PM: suspend test failed, error %d\n";
- static char info_test [] __initdata =
+ static char info_test[] __initdata =
KERN_INFO "PM: test RTC wakeup from '%s' suspend\n";
unsigned long now;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-
Re: [patch 2.6.26-rc4-git] PM: boot time suspend selftest
On Thu, 29 May 2008 13:33:41 -0700 David Brownell wrote:
> Boot-time test for system suspend states (STR or standby). The generic
> RTC framework triggers wakeup alarms, which are used to exit those states.
>
> - Measures some aspects of suspend time ... this uses "jiffies" until
> someone converts it to use a timebase that works properly even while
> timer IRQs are disabled.
>
> - Triggered by a command line parameter. By default nothing even
> vaguely troublesome will happen, but "test_suspend=mem" will give
> you a brief STR test during system boot. (Or you may need to use
> "test_suspend=standby" instead, if your hardware needs that.)
>
> This isn't without problems. It fires early enough during boot that for
> example both PCMCIA and MMC stacks have misbehaved. The workaround in
> those cases was to boot without such media cards inserted.
mips allmodconfig:
kernel/built-in.o(.init.text+0x5b30): In function `test_suspend':
: undefined reference to `rtc_class'
kernel/built-in.o(.init.text+0x5b38): In function `test_suspend':
: undefined reference to `rtc_class'
kernel/built-in.o(.init.text+0x5ba4): In function `test_suspend':
: undefined reference to `rtc_class_open'
kernel/built-in.o(.init.text+0x5c30): In function `test_suspend':
: undefined reference to `rtc_read_time'
kernel/built-in.o(.init.text+0x5d50): In function `test_suspend':
: undefined reference to `rtc_set_alarm'
kernel/built-in.o(.init.text+0x5f6c): In function `test_suspend':
: undefined reference to `rtc_class_close'
some of these are already exported, so something else went wrong.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/