Skip to contentSkip to conversation

swsusp: Make userland suspend work on SMP again

PATCH In review Rafael J. Wysocki 3 participants 4 messages Oct 4, 2006 – Oct 6, 2006

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

PATCH 1/1 swsusp: Make userland suspend work on SMP again

Unfortunately one of the recent changes in swsusp has broken the userland suspend on SMP. Fix it.

---

---
 kernel/power/user.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/power/user.c +1 -1
Index: linux-2.6.18-mm3/kernel/power/user.c
===================================================================
@@ -149,10 +149,10 @@ static int snapshot_ioctl(struct inode *
 			error = freeze_processes();
 			if (error) {
 				thaw_processes();
+				enable_nonboot_cpus();
 				error = -EBUSY;
 			}
 		}
-		enable_nonboot_cpus();
 		up(&pm_sem);
 		if (!error)
 			data->frozen = 1;
#1 lore raw
Quoted 4 lines · Rafael J. Wysocki

Unfortunately one of the recent changes in swsusp has broken the userland suspend on SMP. Fix it.

ACK.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#2 lore raw
In reply to Rafael J. Wysocki
Quoted 3 lines · On Wed, 4 Oct 2006 22:26:42 +0200 "Rafael J. Wysocki" <[email protected]> wrote:

Unfortunately one of the recent changes in swsusp has broken the userland suspend on SMP. Fix it.

Which patch does this fix?

Quoted 6 lines

---

---
 kernel/power/user.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.18-mm3/kernel/power/user.c

I'll assume from this that your patch is applicable to -mm and that mainline doesn't have this bug.

I'll further assume that it's swsusp-add-ioctl-for-swap-files-support.patch which added the bug.

Quoted 15 lines

===================================================================

kernel/power/user.c +1 -1
@@ -149,10 +149,10 @@ static int snapshot_ioctl(struct inode *
 			error = freeze_processes();
 			if (error) {
 				thaw_processes();
+				enable_nonboot_cpus();
 				error = -EBUSY;
 			}
 		}
-		enable_nonboot_cpus();
 		up(&pm_sem);
 		if (!error)
 			data->frozen = 1;
#3 lore raw
Quoted 8 lines · Andrew Morton
Quoted 3 lines · On Wed, 4 Oct 2006 22:26:42 +0200 "Rafael J. Wysocki" <[email protected]> wrote:

Unfortunately one of the recent changes in swsusp has broken the userland suspend on SMP. Fix it.

Which patch does this fix?

Commit e3920fb42c8ddfe63befb54d95c0e13eabacea9b (Disable CPU hotplug during suspend) in the Linus' tree.