Skip to contentSkip to conversation

smp support for s3 (not yet working)

PATCH Pavel Machek 2 participants 2 messages Jul 6, 2004 1 message not in the archive

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

Hi!

Supporting SMP on S3 will be harder than SMP on swsusp... For swsusp, all cpus are initialized by kernel doing the resume, so we can just stop them and restart them. For S3, we'll have to kick start cpus by hand :-(.

If you remove code in acpi_restore_state_mem, it will actually resume, enable to type commands into bash, but die very soon because second cpu is not active.

If there's easy way to kick c to life, let me know...

Pavel

arch/i386/kernel/acpi/sleep.c +6 -0
@@ -60,6 +60,12 @@
  */
 void acpi_restore_state_mem (void)
 {
+	printk("Preparing cpus...\n");
+	smp_prepare_cpus(2);
+
+	printk("CPUs ready\n");
+
+	printk("Zapping mappings\n");
 	zap_low_mappings();
 }
 
arch/i386/kernel/smpboot.c +24 -20

176 lines not on this page · raw message

kernel/power/main.c +11 -2
@@ -64,9 +64,11 @@
 		goto Thaw;
 	}
 
+	disable_nonboot_cpus();
+
 	if (pm_ops->prepare) {
 		if ((error = pm_ops->prepare(state)))
-			goto Thaw;
+			goto Thaw2;
 	}
 
 	if ((error = device_suspend(state)))
@@ -75,6 +77,10 @@
  Finish:
 	if (pm_ops->finish)
 		pm_ops->finish(state);
+
+ Thaw2:
+	printk("Enabling all cpus\n");
+	enable_nonboot_cpus();
  Thaw:
 	thaw_processes();
 	pm_restore_console();
@@ -144,12 +150,14 @@
 	if (down_trylock(&pm_sem))
 		return -EBUSY;
 
+#if 0
 	/* Suspend is hard to get right on SMP. */
 	if (num_online_cpus() != 1) {
+		printk("Suspends not supported on SMP\n");
 		error = -EPERM;
 		goto Unlock;
 	}
-
+#endif
 	if (state == PM_SUSPEND_DISK) {
 		error = pm_suspend_disk();
 		goto Unlock;
@@ -164,6 +172,7 @@
 
 	pr_debug("PM: Finishing up.\n");
 	suspend_finish(state);
+
  Unlock:
 	up(&pm_sem);
 	return error;
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!
#2 lore raw
In reply to a message not in the archive

Hi!

Quoted 10 lines

Supporting SMP on S3 will be harder than SMP on swsusp... For swsusp, all cpus are initialized by kernel doing the resume, so we can just stop them and restart them. For S3, we'll have to kick start cpus by hand :-(.

If you remove code in acpi_restore_state_mem, it will actually resume, enable to type commands into bash, but die very soon because second cpu is not active.

If there's easy way to kick c to life, let me know...

Oh and Intel please fix your mailservers...

Pavel

To: [email protected]
To: [email protected]
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on
atrey.karlin.mff.cuni.cz
X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.63
X-Spam-Level:
X-CRM114-Status: Good ( pR: 105.9352 )

[-- Attachment #1 --]
[-- Type: text/plain, Encoding: 7bit, Size: 0.4K --]

The original message was received at Tue, 6 Jul 2004 12:05:35 GMT from gprs214-134.eurotel.cz [160.218.214.134]

----- The following addresses had permanent fatal errors -----
<[email protected]> <[email protected]>

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


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com