Skip to contentSkip to conversation

Enable swsusp on SMP machines

PATCH Pavel Machek 2 participants 3 messages Jan 24, 2005 – Jan 25, 2005

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

Hi!

This enables swsusp on SMP machines. It should be working in 2.6.10, already (but you may need noapic in 2.6.10). Please apply,

Pavel

kernel/power/main.c renamed from data/l/READ-ONLY/linux/kernel/power/main.c +5 -5
@@ -141,14 +141,14 @@
 	if (down_trylock(&pm_sem))
 		return -EBUSY;
 
-	/* Suspend is hard to get right on SMP. */
-	if (num_online_cpus() != 1) {
-		error = -EPERM;
+	if (state == PM_SUSPEND_DISK) {
+		error = pm_suspend_disk();
 		goto Unlock;
 	}
 
-	if (state == PM_SUSPEND_DISK) {
-		error = pm_suspend_disk();
+	/* Suspend is hard to get right on SMP. */
+	if (num_online_cpus() != 1) {
+		error = -EPERM;
 		goto Unlock;
 	}
 
Signature · 2 lines
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
#1 lore raw
Quoted 5 lines · Pavel Machek
kernel/power/main.c renamed from data/l/READ-ONLY/linux/kernel/power/main.c +2 -3
-	/* Suspend is hard to get right on SMP. */
-	if (num_online_cpus() != 1) {
-		error = -EPERM;
+	if (state == PM_SUSPEND_DISK) {
+		error = pm_suspend_disk();

kernel/power/main.c line 153

Quoted 10 lines
kernel/power/main.c renamed from data/l/READ-ONLY/linux/kernel/power/main.c +3 -2
 		goto Unlock;
 	}
 
-	if (state == PM_SUSPEND_DISK) {
-		error = pm_suspend_disk();
+	/* Suspend is hard to get right on SMP. */
+	if (num_online_cpus() != 1) {
+		error = -EPERM;
 		goto Unlock;
 	}

Are you sure about this?

Signature · 1 line
Matthew Garrett | [email protected]
#2 lore raw

Hi!

Quoted 8 lines
Quoted 8 lines
kernel/power/main.c renamed from data/l/READ-ONLY/linux/kernel/power/main.c +2 -3
-	/* Suspend is hard to get right on SMP. */
-	if (num_online_cpus() != 1) {
-		error = -EPERM;
+	if (state == PM_SUSPEND_DISK) {
+		error = pm_suspend_disk();
 		goto Unlock;
 	}
Quoted 9 lines

kernel/power/main.c line 153

Quoted 7 lines
kernel/power/main.c renamed from data/l/READ-ONLY/linux/kernel/power/main.c +3 -2
-	if (state == PM_SUSPEND_DISK) {
-		error = pm_suspend_disk();
+	/* Suspend is hard to get right on SMP. */
+	if (num_online_cpus() != 1) {
+		error = -EPERM;
 		goto Unlock;
 	}

Are you sure about this?

Yes, as we already agreed on in private mails ;-). The diff really is confusing.
Pavel

Signature · 2 lines
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!