public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: linux-pm <linux-pm@lists.osdl.org>
Cc: David Woodhouse <dwmw2@infradead.org>, Pavel Machek <pavel@ucw.cz>
Subject: [PATCH] s2ram: add arch irq disable/enable hooks
Date: Tue, 17 Apr 2007 19:18:10 +0200	[thread overview]
Message-ID: <1176830290.6225.9.camel@johannes.berg> (raw)
In-Reply-To: <1175810054.3489.34.camel@johannes.berg>

For powermac, we need to do some things between suspending devices and
device_power_off, for example setting the decrementer. This patch
allows architectures to define arch_s2ram_{en,dis}able_irqs in their
asm/suspend.h to have control over this step.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>

---
Even though I don't like it, here it is. I still don't see why this
shouldn't be part of pm_ops when pm_ops is responsible for everything
else related to s2ram. But it at least lets me do what I need to.

 kernel/power/main.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

--- wireless-dev.orig/kernel/power/main.c	2007-04-17 18:52:24.536830941 +0200
+++ wireless-dev/kernel/power/main.c	2007-04-17 19:09:40.966830941 +0200
@@ -128,13 +128,22 @@ static int suspend_prepare(suspend_state
 	return error;
 }
 
+#ifndef arch_s2ram_disable_irqs
+#define arch_s2ram_disable_irqs(flags) local_irq_save(*flags)
+#endif
+
+#ifndef arch_s2ram_enable_irqs
+#define arch_s2ram_enable_irqs(flags) local_irq_restore(*flags)
+#endif
+
 
 int suspend_enter(suspend_state_t state)
 {
 	int error = 0;
 	unsigned long flags;
 
-	local_irq_save(flags);
+	arch_s2ram_disable_irqs(&flags);
+	BUG_ON(!irqs_disabled());
 
 	if ((error = device_power_down(PMSG_SUSPEND))) {
 		printk(KERN_ERR "Some devices failed to power down\n");
@@ -143,7 +152,8 @@ int suspend_enter(suspend_state_t state)
 	error = pm_ops->enter(state);
 	device_power_up();
  Done:
-	local_irq_restore(flags);
+	arch_s2ram_enable_irqs(&flags);
+	BUG_ON(irqs_disabled());
 	return error;
 }
 

  parent reply	other threads:[~2007-04-17 17:18 UTC|newest]

Thread overview: 122+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-05 21:54 [PATCH] pm_ops: add irq enable/disable hooks Johannes Berg
2007-04-05 23:30 ` Rafael J. Wysocki
2007-04-05 23:28   ` Johannes Berg
2007-04-06  0:02     ` Rafael J. Wysocki
2007-04-06  0:09       ` Johannes Berg
2007-04-06  0:17         ` Rafael J. Wysocki
2007-04-06  8:48           ` Johannes Berg
2007-04-06  9:41             ` Rafael J. Wysocki
2007-04-06  9:44               ` Johannes Berg
2007-04-06 10:02                 ` Rafael J. Wysocki
2007-04-06 10:00                   ` Johannes Berg
2007-04-06 19:19                 ` Pavel Machek
2007-04-06 21:59                   ` Johannes Berg
2007-04-10 11:36                     ` Pavel Machek
2007-04-10 11:45                       ` Johannes Berg
2007-04-10 12:00                         ` Pavel Machek
2007-04-10 13:42                           ` Johannes Berg
2007-04-11 11:22                           ` Benjamin Herrenschmidt
2007-04-11 14:07                             ` Alan Stern
2007-04-11 16:39                               ` Johannes Berg
2007-04-11 21:40                               ` Benjamin Herrenschmidt
2007-04-11 11:15                       ` Johannes Berg
2007-04-06 19:16 ` Pavel Machek
2007-04-11 15:54 ` [PATCH v2] pm_ops: add system quiesce/activate hooks Johannes Berg
2007-04-11 20:47   ` Dmitry Krivoschekov
2007-04-12  8:39     ` Johannes Berg
2007-04-12  8:42     ` Benjamin Herrenschmidt
2007-04-12 10:16       ` Pavel Machek
2007-04-12 10:45         ` Rafael J. Wysocki
2007-04-12 10:47         ` Johannes Berg
2007-04-13 21:00           ` Pavel Machek
2007-04-13 21:11             ` Paul Mackerras
2007-04-13 21:11             ` Johannes Berg
2007-04-13 21:43               ` Pavel Machek
2007-04-13 21:15             ` Benjamin Herrenschmidt
2007-04-12 11:23         ` Benjamin Herrenschmidt
2007-04-12 15:03           ` Rafael J. Wysocki
2007-04-12 16:32             ` David Brownell
2007-04-13  6:52               ` Johannes Berg
2007-04-13  7:59               ` [PATCH v3] " Johannes Berg
2007-04-12 17:36           ` [PATCH v2] " Dmitry Krivoschekov
2007-04-12 20:51             ` Benjamin Herrenschmidt
2007-04-13  6:54             ` Johannes Berg
2007-04-13  8:04               ` David Brownell
2007-04-13  8:59             ` Johannes Berg
2007-04-13  9:07               ` Benjamin Herrenschmidt
2007-04-13 11:47                 ` Rafael J. Wysocki
2007-04-13 12:58                   ` Johannes Berg
2007-04-13 13:26                   ` [PATCH v4] " Johannes Berg
2007-04-13 20:43                     ` Rafael J. Wysocki
2007-04-13 20:58                       ` Pavel Machek
2007-04-13 21:06                         ` Johannes Berg
2007-04-13 21:12                           ` Pavel Machek
2007-04-13 21:18                             ` Johannes Berg
2007-04-13 21:33                               ` Pavel Machek
2007-04-13 21:45                                 ` Johannes Berg
2007-04-13 21:52                                   ` Pavel Machek
2007-04-13 21:59                                     ` Johannes Berg
2007-04-13 22:18                                       ` Rafael J. Wysocki
2007-04-13 22:20                                         ` Johannes Berg
2007-04-13 22:49                                           ` Rafael J. Wysocki
2007-04-13 22:55                                             ` Johannes Berg
2007-04-13 22:09                                 ` Rafael J. Wysocki
2007-04-13 22:13                                   ` Johannes Berg
2007-04-13 22:16                                     ` Pavel Machek
2007-04-14 16:55                                       ` Paul Mackerras
2007-04-13 22:25                                   ` Benjamin Herrenschmidt
2007-04-13 22:39                                     ` Pavel Machek
2007-04-13 23:19                                       ` Benjamin Herrenschmidt
2007-04-14  9:14                                         ` Rafael J. Wysocki
2007-04-14  9:19                                           ` Johannes Berg
2007-04-15  0:19                                             ` Benjamin Herrenschmidt
2007-04-16  7:32                                         ` Pavel Machek
2007-04-16  8:37                                           ` Johannes Berg
2007-04-16 12:47                                             ` Pavel Machek
2007-04-17  4:58                                             ` Paul Mackerras
2007-04-18  7:50                                           ` Benjamin Herrenschmidt
2007-04-13 22:47                                     ` Rafael J. Wysocki
2007-04-13 21:18                             ` Benjamin Herrenschmidt
2007-04-13 21:56                               ` Pavel Machek
2007-04-13 22:01                                 ` Johannes Berg
2007-04-13 22:24                                 ` Benjamin Herrenschmidt
2007-04-13 21:15                         ` Benjamin Herrenschmidt
2007-04-13 21:50                           ` Pavel Machek
2007-04-13 22:23                             ` Benjamin Herrenschmidt
2007-04-14 22:10                               ` David Brownell
2007-04-13 21:05             ` [PATCH v2] " Pavel Machek
2007-04-12  8:44     ` Benjamin Herrenschmidt
2007-04-17 17:18 ` Johannes Berg [this message]
2007-04-18 11:27   ` [PATCH] s2ram: add arch irq disable/enable hooks Pavel Machek
  -- strict thread matches above, loose matches on Subject: below --
2007-04-19 11:00 Johannes Berg
2007-04-19 21:55 ` Andrew Morton
2007-04-20 15:34   ` Johannes Berg
2007-04-20  6:57 ` Greg KH
2007-04-20 15:31   ` Johannes Berg
2007-04-20 17:39     ` Greg KH
2007-04-20 19:37       ` Johannes Berg
2007-04-20 19:44         ` Andrew Morton
2007-04-20 19:51           ` Johannes Berg
2007-04-20 20:36             ` Rafael J. Wysocki
2007-04-20 20:51               ` Johannes Berg
2007-04-20 21:08                 ` Rafael J. Wysocki
2007-04-21 13:57 ` Johannes Berg
2007-04-21 14:07   ` Pavel Machek
2007-04-21 15:41   ` David Brownell
2007-04-21 16:16     ` Johannes Berg
2007-04-21 16:55       ` David Brownell
2007-04-21 17:01         ` Johannes Berg
2007-04-21 17:06           ` David Brownell
2007-04-21 17:49             ` Johannes Berg
2007-04-21 21:47               ` Pavel Machek
2007-04-21 22:04                 ` Johannes Berg
2007-04-21 21:45             ` Pavel Machek
2007-04-22  3:10               ` David Brownell
2007-04-22 13:09                 ` Pavel Machek
2007-04-26 11:02                   ` David Woodhouse
2007-04-21 21:44     ` Pavel Machek
2007-04-22  3:05       ` David Brownell
2007-04-22 13:13         ` Pavel Machek
2007-04-24 13:51           ` Johannes Berg
2007-04-24 18:16             ` Pavel Machek
2007-04-25  3:45               ` David Brownell

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=1176830290.6225.9.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=dwmw2@infradead.org \
    --cc=linux-pm@lists.osdl.org \
    --cc=pavel@ucw.cz \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox