All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] [PATCH] suspend your real-time system
Date: Sun, 09 Jul 2006 19:19:53 +0200	[thread overview]
Message-ID: <44B13AB9.1050306@domain.hid> (raw)


[-- 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 --]

                 reply	other threads:[~2006-07-09 17:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=44B13AB9.1050306@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=xenomai@xenomai.org \
    /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.