* [Xenomai-core] [PATCH] suspend your real-time system
@ 2006-07-09 17:19 Jan Kiszka
0 siblings, 0 replies; only message in thread
From: Jan Kiszka @ 2006-07-09 17:19 UTC (permalink / raw)
To: xenomai-core
[-- Attachment #1.1: Type: text/plain, Size: 381 bytes --]
Hi,
it's a bit crazy but it seems to work: This tiny patch against an I-pipe
kernel really allows suspend to disk/ram for a *running* Xenomai system.
Just the TSC-based timers are skewed up after resume so that, e.g., the
latency test takes a longer pause then. But a serious use-case would
rather include a real-time application shutdown before suspend anyway.
Jan
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: hard-irq-disable-on-suspend-resume.patch --]
[-- Type: text/x-patch; name="hard-irq-disable-on-suspend-resume.patch", Size: 1306 bytes --]
---
kernel/power/swsusp.c | 4 ++++
1 file changed, 4 insertions(+)
Index: linux-2.6.17-ipipe/kernel/power/swsusp.c
===================================================================
--- linux-2.6.17-ipipe.orig/kernel/power/swsusp.c
+++ linux-2.6.17-ipipe/kernel/power/swsusp.c
@@ -217,6 +217,7 @@ int swsusp_suspend(void)
if ((error = arch_prepare_suspend()))
return error;
local_irq_disable();
+ local_irq_disable_hw();
/* At this point, device_suspend() has been called, but *not*
* device_power_down(). We *must* device_power_down() now.
* Otherwise, drivers for some devices (e.g. interrupt controllers)
@@ -242,6 +243,7 @@ Restore_highmem:
restore_highmem();
device_power_up();
Enable_irqs:
+ local_irq_enable_hw();
local_irq_enable();
return error;
}
@@ -250,6 +252,7 @@ int swsusp_resume(void)
{
int error;
local_irq_disable();
+ local_irq_disable_hw();
if (device_power_down(PMSG_FREEZE))
printk(KERN_ERR "Some devices failed to power down, very bad\n");
/* We'll ignore saved state, but this gets preempt count (etc) right */
@@ -268,6 +271,7 @@ int swsusp_resume(void)
restore_highmem();
touch_softlockup_watchdog();
device_power_up();
+ local_irq_enable_hw();
local_irq_enable();
return error;
}
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-07-09 17:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-09 17:19 [Xenomai-core] [PATCH] suspend your real-time system Jan Kiszka
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.