Hi!
I'm trying to reuse trampoline_64.S for wakeup from ACPI s3... but I'm
getting some badness: If I insert delay loops into trampoline_64.S,
machine fails to boot; but I already increased cpu bootup delay to 200
seconds...
Is it possible that bootup is subtly racy somewhere?
diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c
index aaf4e12..3961bcb 100644
--- a/arch/x86/kernel/smpboot_64.c
+++ b/arch/x86/kernel/smpboot_64.c
@@ -188,7 +188,7 @@ void __cpuinit smp_callin(void)
/*
* Waiting 2s total for startup (udelay is not yet working)
*/
- timeout = jiffies + 2*HZ;
+ timeout = jiffies + 200*HZ;
while (time_before(jiffies, timeout)) {
/*
* Has the boot CPU finished it's STARTUP sequence?
diff --git a/arch/x86/kernel/trampoline_64.S b/arch/x86/kernel/trampoline_64.S
index 4aedd0b..34fe9a7 100644
--- a/arch/x86/kernel/trampoline_64.S
+++ b/arch/x86/kernel/trampoline_64.S
@@ -24,12 +24,48 @@
* entries.
*/
+
#include <linux/linkage.h>
#include <asm/pgtable.h>
#include <asm/page.h>
#include <asm/msr.h>
#include <asm/segment.h>
+
+#define BEEP \
+ inb $97, %al; \
+ outb %al, $0x80; \
+ movb $3, %al; \
+ outb %al, $97; \
+ outb %al, $0x80; \
+ movb $-74, %al; \
+ outb %al, $67; \
+ outb %al, $0x80; \
+ movb $-119, %al; \
+ outb %al, $66; \
+ outb %al, $0x80; \
+ movb $15, %al; \
+ outb %al, $66;
+
+#define DISPLAY(x) \
+ pushl %eax ; \
+ movb $x, %al; \
+ outb %al, $0x80; \
+ popl %eax
+
+#define DISPLAY_UNSAFE(x) \
+ movb $x, %al; \
+ outb %al, $0x80; \
+
+#define DELAY_OK \
+ movl $0x30000000,%ecx ; \
+9: loopl 9b ;
+
+#define DELAY \
+ movl $1,%ecx ; \
+9: loopl 9b ;
+
+
/* We can free up trampoline after bootup if cpu hotplug is not supported. */
#ifndef CONFIG_HOTPLUG_CPU
.section .init.data, "aw", @progbits
@@ -55,6 +91,9 @@ r_base = .
# Setup stack
movw $(trampoline_stack_end - r_base), %sp
+ DISPLAY(0x70)
+ DELAY
+
...