Skip to contentSkip to conversation

suspend to ram problem

DISCUSSION matthieu castet 4 participants 39 messages Feb 3, 2008 – Feb 8, 2008 ACPI

lore
Share & tools
lore
#0 lore raw

Hi,

I am trying to make work suspend to ram on a MSI MS-6380E with a 2.6.23 kernel.

Standby mode works.
S2ram suspend seems to work : the computer turn off and I can wake up it with the keyboard.

But when the computer wakeup, I see the video card POST on the screen, but after that the computer hangs : black screen, no working numlock.

I tried to compile PM_TRACE, but it give no result. So this means the resume hang very early.

What can I do to debug this ?

Thanks

Matthieu

#1 lore raw
Quoted 4 lines · matthieu castet

Hi,

I am trying to make work suspend to ram on a MSI MS-6380E with a 2.6.23 kernel.

Quoted 9 lines

Standby mode works.
S2ram suspend seems to work : the computer turn off and I can wake up it with the keyboard.

But when the computer wakeup, I see the video card POST on the screen, but after that the computer hangs : black screen, no working numlock.

I tried to compile PM_TRACE, but it give no result. So this means the resume hang very early.

What can I do to debug this ?

I play with the s2_beep feature and :
- echo 4 > /proc/sys/kernel/acpi_video_flags make the computer beep
- echo 4 > /proc/sys/kernel/acpi_video_flags make the computer not beep
- adding a beep in bogus_real_magic, make the computer not beep

So the hang seems located in wakeup_start.

Matthieu

#2 lore raw
Quoted 16 lines · matthieu castet
Quoted 15 lines · matthieu castet

Hi,

I am trying to make work suspend to ram on a MSI MS-6380E with a 2.6.23 kernel.

Standby mode works.
S2ram suspend seems to work : the computer turn off and I can wake up it with the keyboard.

But when the computer wakeup, I see the video card POST on the screen, but after that the computer hangs : black screen, no working numlock.

I tried to compile PM_TRACE, but it give no result. So this means the resume hang very early.

Quoted 8 lines
Quoted 2 lines

What can I do to debug this ?

I play with the s2_beep feature and :
- echo 4 > /proc/sys/kernel/acpi_video_flags make the computer beep
- echo 4 > /proc/sys/kernel/acpi_video_flags make the computer not beep
- adding a beep in bogus_real_magic, make the computer not beep

So the hang seems located in wakeup_start.

Hm. Can you add unconditional BEEP after "jne bogus_real_magic" in arch/x86/kernel/acpi/wakeup.S and see if it beeps?

Rafael

#3 lore raw
In reply to matthieu castet
Quoted 16 lines · matthieu castet
Quoted 15 lines · matthieu castet

Hi,

I am trying to make work suspend to ram on a MSI MS-6380E with a 2.6.23 kernel.

Standby mode works.
S2ram suspend seems to work : the computer turn off and I can wake up it with the keyboard.

But when the computer wakeup, I see the video card POST on the screen, but after that the computer hangs : black screen, no working numlock.

I tried to compile PM_TRACE, but it give no result. So this means the resume hang very early.

Quoted 8 lines
Quoted 2 lines

What can I do to debug this ?

I play with the s2_beep feature and :
- echo 4 > /proc/sys/kernel/acpi_video_flags make the computer beep
- echo 4 > /proc/sys/kernel/acpi_video_flags make the computer not beep
- adding a beep in bogus_real_magic, make the computer not beep

So the hang seems located in wakeup_start.

Hm. Can you add unconditional BEEP after "jne bogus_real_magic" in arch/x86/kernel/acpi/wakeup.S and see if it beeps?

Rafael

#4 lore raw
Quoted 24 lines · Rafael J. Wysocki
Quoted 23 lines · matthieu castet
Quoted 9 lines · matthieu castet

Hi,

I am trying to make work suspend to ram on a MSI MS-6380E with a 2.6.23 kernel.

Standby mode works.
S2ram suspend seems to work : the computer turn off and I can wake up it with the keyboard.

Quoted 8 lines

But when the computer wakeup, I see the video card POST on the screen, but after that the computer hangs : black screen, no working numlock.

I tried to compile PM_TRACE, but it give no result. So this means the resume hang very early.

What can I do to debug this ?

I play with the s2_beep feature and :
- echo 4 > /proc/sys/kernel/acpi_video_flags make the computer beep
- echo 4 > /proc/sys/kernel/acpi_video_flags make the computer not beep
- adding a beep in bogus_real_magic, make the computer not beep

Quoted 4 lines
Quoted 1 line

So the hang seems located in wakeup_start.

Hm. Can you add unconditional BEEP after "jne bogus_real_magic" in arch/x86/kernel/acpi/wakeup.S and see if it beeps?

Hmm, maybe I know where problem could be. Try

        movl     $(wakeup_stack - wakeup_code), %esp              # Private stack is needed for ASUS bo\

instead of existing stack setup. That helped on one of my test-boxes -- I uncovered that during rewrite.

Otherwise use BEEP and infinite loops to find out where it hangs...

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#5 lore raw
Quoted 30 lines · Pavel Machek
Quoted 24 lines · Rafael J. Wysocki
Quoted 23 lines · matthieu castet
Quoted 9 lines · matthieu castet

Hi,

I am trying to make work suspend to ram on a MSI MS-6380E with a 2.6.23 kernel.

Standby mode works.
S2ram suspend seems to work : the computer turn off and I can wake up it with the keyboard.

Quoted 8 lines

But when the computer wakeup, I see the video card POST on the screen, but after that the computer hangs : black screen, no working numlock.

I tried to compile PM_TRACE, but it give no result. So this means the resume hang very early.

What can I do to debug this ?

I play with the s2_beep feature and :
- echo 4 > /proc/sys/kernel/acpi_video_flags make the computer beep
- echo 4 > /proc/sys/kernel/acpi_video_flags make the computer not beep
- adding a beep in bogus_real_magic, make the computer not beep

Quoted 4 lines
Quoted 1 line

So the hang seems located in wakeup_start.

Hm. Can you add unconditional BEEP after "jne bogus_real_magic" in arch/x86/kernel/acpi/wakeup.S and see if it beeps?

Quoted 6 lines

Hmm, maybe I know where problem could be. Try

        movl     $(wakeup_stack - wakeup_code), %esp              # Private stack is needed for ASUS bo\

instead of existing stack setup. That helped on one of my test-boxes -- I uncovered that during rewrite.

Well, that could explain some mysterious failures reported from time to time by ASUS users.

Rafael

#6 lore raw
In reply to Pavel Machek
Quoted 30 lines · Pavel Machek
Quoted 24 lines · Rafael J. Wysocki
Quoted 23 lines · matthieu castet
Quoted 9 lines · matthieu castet

Hi,

I am trying to make work suspend to ram on a MSI MS-6380E with a 2.6.23 kernel.

Standby mode works.
S2ram suspend seems to work : the computer turn off and I can wake up it with the keyboard.

Quoted 8 lines

But when the computer wakeup, I see the video card POST on the screen, but after that the computer hangs : black screen, no working numlock.

I tried to compile PM_TRACE, but it give no result. So this means the resume hang very early.

What can I do to debug this ?

I play with the s2_beep feature and :
- echo 4 > /proc/sys/kernel/acpi_video_flags make the computer beep
- echo 4 > /proc/sys/kernel/acpi_video_flags make the computer not beep
- adding a beep in bogus_real_magic, make the computer not beep

Quoted 4 lines
Quoted 1 line

So the hang seems located in wakeup_start.

Hm. Can you add unconditional BEEP after "jne bogus_real_magic" in arch/x86/kernel/acpi/wakeup.S and see if it beeps?

Quoted 6 lines

Hmm, maybe I know where problem could be. Try

        movl     $(wakeup_stack - wakeup_code), %esp              # Private stack is needed for ASUS bo\

instead of existing stack setup. That helped on one of my test-boxes -- I uncovered that during rewrite.

Well, that could explain some mysterious failures reported from time to time by ASUS users.

Rafael

#7 lore raw
In reply to Pavel Machek
Quoted 5 lines · Pavel Machek
Quoted 3 lines · Rafael J. Wysocki
Quoted 1 line

So the hang seems located in wakeup_start.

Hm. Can you add unconditional BEEP after "jne bogus_real_magic" in arch/x86/kernel/acpi/wakeup.S and see if it beeps?

I rewrite the beep tracer to generate small beep (I should clean the patch and try to submit it), and I only hear 2 beep.

So it crash when clearing the flags.

Quoted 6 lines

Hmm, maybe I know where problem could be. Try

        movl     $(wakeup_stack - wakeup_code), %esp              # Private stack is needed for ASUS bo\

instead of existing stack setup. That helped on one of my test-boxes

Thanks, I will try that.
Because clearing the flags imply pop/push in the stack it could be the problem

Matthieu

i386/kernel/acpi/wakeup.S renamed from home/mat/tmp/wakeup.S +57 -27
@@ -13,20 +13,47 @@
 # cs = 0x1234, eip = 0x05
 # 
 
+/* one ISA cycle @8Mhz */
+#define PAUSE outb %al, $0x80
+#define WAIT_100MS \
+	movl $800000, %eax; \
+	2: \
+	PAUSE; \
+	dec %eax; \
+	jne 2b
+
+/* What's the PIT rate */
+#define COUNT 0xf89
 #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;
+	/* enable counter 2 */ \
+	inb		$0x61, %al; 	\
+	PAUSE; 	\
+	orb	$3, %al; \
+	outb	%al, $0x61; 	\
+	PAUSE; 	\
+	/* set command for counter 2, 2 byte write */ \
+	movb	$0xB6, %al; 	\
+	outb	%al, $0x43; 	\
+	PAUSE; 	\
+	/* select desired HZ */ \
+	movb	$(COUNT & 0xff), %al; \
+	outb	%al, $0x42; 	\
+	PAUSE; 	\
+	movb	$(COUNT >> 8), %al; 	\
+	outb	%al, $0x42; \
+	WAIT_100MS; \
+	/* disable counter 2 */ \
+	inb		$0x61, %al; 	\
+	PAUSE; 	\
+	andb	$0xFC, %al; \
+	outb	%al, $0x61; \
+	WAIT_100MS
+
+#define CBEEP \
+	testl   $4, realmode_flags - wakeup_code; \
+	jz      1f; \
+	BEEP; \
+1:
 
 ALIGN
 	.align	4096
@@ -37,7 +64,8 @@
 
  	movw	$0xb800, %ax
 	movw	%ax,%fs
-	movw	$0x0e00 + 'L', %fs:(0x10)
+	#movw	$0x0e00 + 'L', %fs:(0x10)
+	CBEEP
 
 	cli
 	cld
@@ -47,19 +75,18 @@
 	movw	%ax, %ds					# Make ds:0 point to wakeup_start
 	movw	%ax, %ss
 
-	testl   $4, realmode_flags - wakeup_code
-	jz      1f
-	BEEP
-1:
 	mov	$(wakeup_stack - wakeup_code), %sp		# Private stack is needed for ASUS board
-	movw	$0x0e00 + 'S', %fs:(0x12)
+	#movw	$0x0e00 + 'S', %fs:(0x12)
+	CBEEP
 
 	pushl	$0						# Kill any dangerous flags
 	popfl
+	CBEEP
 
 	movl	real_magic - wakeup_code, %eax
 	cmpl	$0x12345678, %eax
 	jne	bogus_real_magic
+	CBEEP
 
 	testl	$1, realmode_flags - wakeup_code
 	jz	1f
@@ -79,6 +106,7 @@
 	movl	$swsusp_pg_dir-__PAGE_OFFSET, %eax
 	movl	%eax, %cr3
 
+	CBEEP
 	testl	$1, real_efer_save_restore - wakeup_code
 	jz	4f
 	# restore efer setting
@@ -87,12 +115,14 @@
 	mov     $0xc0000080, %ecx
 	wrmsr
 4:
+	CBEEP
 	# make sure %cr4 is set correctly (features, etc)
 	movl	real_save_cr4 - wakeup_code, %eax
 	movl	%eax, %cr4
 	movw	$0xb800, %ax
 	movw	%ax,%fs
-	movw	$0x0e00 + 'i', %fs:(0x12)
+	#movw	$0x0e00 + 'i', %fs:(0x12)
+	CBEEP
 	
 	# need a gdt -- use lgdtl to force 32-bit operands, in case
 	# the GDT is located past 16 megabytes.
@@ -102,15 +132,14 @@
 	movl	%eax, %cr0
 	jmp 1f
 1:
-	movw	$0x0e00 + 'n', %fs:(0x14)
+	#movw	$0x0e00 + 'n', %fs:(0x14)
+	CBEEP
 
 	movl	real_magic - wakeup_code, %eax
 	cmpl	$0x12345678, %eax
 	jne	bogus_real_magic
 
-	testl   $8, realmode_flags - wakeup_code
-	jz      1f
-	BEEP
+	CBEEP
 1:
 	ljmpl	$__KERNEL_CS, $wakeup_pmode_return
 
@@ -128,7 +157,8 @@
 real_save_efer_eax: 	.long 0
 
 bogus_real_magic:
-	movw	$0x0e00 + 'B', %fs:(0x12)
+	BEEP
+	#movw	$0x0e00 + 'B', %fs:(0x12)
 	jmp bogus_real_magic
 
 /* This code uses an extended set of video mode numbers. These include:
@@ -194,7 +224,7 @@
 	movw	%ax, %es
 	movw	%ax, %fs
 	movw	%ax, %gs
-	movw	$0x0e00 + 'u', 0xb8016
+	#movw	$0x0e00 + 'u', 0xb8016
 
 	# reload the gdt, as we need the full 32 bit address
 	lgdt	saved_gdt
@@ -218,7 +248,7 @@
 	jmp	*%eax
 
 bogus_magic:
-	movw	$0x0e00 + 'B', 0xb8018
+	#movw	$0x0e00 + 'B', 0xb8018
 	jmp	bogus_magic
 
 
#8 lore raw
In reply to Pavel Machek
Quoted 5 lines · Pavel Machek
Quoted 3 lines · Rafael J. Wysocki
Quoted 1 line

So the hang seems located in wakeup_start.

Hm. Can you add unconditional BEEP after "jne bogus_real_magic" in arch/x86/kernel/acpi/wakeup.S and see if it beeps?

I rewrite the beep tracer to generate small beep (I should clean the patch and try to submit it), and I only hear 2 beep.

So it crash when clearing the flags.

Quoted 6 lines

Hmm, maybe I know where problem could be. Try

        movl     $(wakeup_stack - wakeup_code), %esp              # Private stack is needed for ASUS bo\

instead of existing stack setup. That helped on one of my test-boxes

Thanks, I will try that.
Because clearing the flags imply pop/push in the stack it could be the problem

Matthieu

i386/kernel/acpi/wakeup.S renamed from home/mat/tmp/wakeup.S +57 -27
@@ -13,20 +13,47 @@
 # cs = 0x1234, eip = 0x05
 # 
 
+/* one ISA cycle @8Mhz */
+#define PAUSE outb %al, $0x80
+#define WAIT_100MS \
+	movl $800000, %eax; \
+	2: \
+	PAUSE; \
+	dec %eax; \
+	jne 2b
+
+/* What's the PIT rate */
+#define COUNT 0xf89
 #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;
+	/* enable counter 2 */ \
+	inb		$0x61, %al; 	\
+	PAUSE; 	\
+	orb	$3, %al; \
+	outb	%al, $0x61; 	\
+	PAUSE; 	\
+	/* set command for counter 2, 2 byte write */ \
+	movb	$0xB6, %al; 	\
+	outb	%al, $0x43; 	\
+	PAUSE; 	\
+	/* select desired HZ */ \
+	movb	$(COUNT & 0xff), %al; \
+	outb	%al, $0x42; 	\
+	PAUSE; 	\
+	movb	$(COUNT >> 8), %al; 	\
+	outb	%al, $0x42; \
+	WAIT_100MS; \
+	/* disable counter 2 */ \
+	inb		$0x61, %al; 	\
+	PAUSE; 	\
+	andb	$0xFC, %al; \
+	outb	%al, $0x61; \
+	WAIT_100MS
+
+#define CBEEP \
+	testl   $4, realmode_flags - wakeup_code; \
+	jz      1f; \
+	BEEP; \
+1:
 
 ALIGN
 	.align	4096
@@ -37,7 +64,8 @@
 
  	movw	$0xb800, %ax
 	movw	%ax,%fs
-	movw	$0x0e00 + 'L', %fs:(0x10)
+	#movw	$0x0e00 + 'L', %fs:(0x10)
+	CBEEP
 
 	cli
 	cld
@@ -47,19 +75,18 @@
 	movw	%ax, %ds					# Make ds:0 point to wakeup_start
 	movw	%ax, %ss
 
-	testl   $4, realmode_flags - wakeup_code
-	jz      1f
-	BEEP
-1:
 	mov	$(wakeup_stack - wakeup_code), %sp		# Private stack is needed for ASUS board
-	movw	$0x0e00 + 'S', %fs:(0x12)
+	#movw	$0x0e00 + 'S', %fs:(0x12)
+	CBEEP
 
 	pushl	$0						# Kill any dangerous flags
 	popfl
+	CBEEP
 
 	movl	real_magic - wakeup_code, %eax
 	cmpl	$0x12345678, %eax
 	jne	bogus_real_magic
+	CBEEP
 
 	testl	$1, realmode_flags - wakeup_code
 	jz	1f
@@ -79,6 +106,7 @@
 	movl	$swsusp_pg_dir-__PAGE_OFFSET, %eax
 	movl	%eax, %cr3
 
+	CBEEP
 	testl	$1, real_efer_save_restore - wakeup_code
 	jz	4f
 	# restore efer setting
@@ -87,12 +115,14 @@
 	mov     $0xc0000080, %ecx
 	wrmsr
 4:
+	CBEEP
 	# make sure %cr4 is set correctly (features, etc)
 	movl	real_save_cr4 - wakeup_code, %eax
 	movl	%eax, %cr4
 	movw	$0xb800, %ax
 	movw	%ax,%fs
-	movw	$0x0e00 + 'i', %fs:(0x12)
+	#movw	$0x0e00 + 'i', %fs:(0x12)
+	CBEEP
 	
 	# need a gdt -- use lgdtl to force 32-bit operands, in case
 	# the GDT is located past 16 megabytes.
@@ -102,15 +132,14 @@
 	movl	%eax, %cr0
 	jmp 1f
 1:
-	movw	$0x0e00 + 'n', %fs:(0x14)
+	#movw	$0x0e00 + 'n', %fs:(0x14)
+	CBEEP
 
 	movl	real_magic - wakeup_code, %eax
 	cmpl	$0x12345678, %eax
 	jne	bogus_real_magic
 
-	testl   $8, realmode_flags - wakeup_code
-	jz      1f
-	BEEP
+	CBEEP
 1:
 	ljmpl	$__KERNEL_CS, $wakeup_pmode_return
 
@@ -128,7 +157,8 @@
 real_save_efer_eax: 	.long 0
 
 bogus_real_magic:
-	movw	$0x0e00 + 'B', %fs:(0x12)
+	BEEP
+	#movw	$0x0e00 + 'B', %fs:(0x12)
 	jmp bogus_real_magic
 
 /* This code uses an extended set of video mode numbers. These include:
@@ -194,7 +224,7 @@
 	movw	%ax, %es
 	movw	%ax, %fs
 	movw	%ax, %gs
-	movw	$0x0e00 + 'u', 0xb8016
+	#movw	$0x0e00 + 'u', 0xb8016
 
 	# reload the gdt, as we need the full 32 bit address
 	lgdt	saved_gdt
@@ -218,7 +248,7 @@
 	jmp	*%eax
 
 bogus_magic:
-	movw	$0x0e00 + 'B', 0xb8018
+	#movw	$0x0e00 + 'B', 0xb8018
 	jmp	bogus_magic
 
 
#9 lore raw
Quoted 10 lines · matthieu castet
Quoted 6 lines · Pavel Machek

Hmm, maybe I know where problem could be. Try

        movl     $(wakeup_stack - wakeup_code), %esp              # 

Private stack is needed for ASUS bo\

instead of existing stack setup. That helped on one of my test-boxes

Thanks, I will try that.
Because clearing the flags imply pop/push in the stack it could be the problem

That doesn't help : it still crash in pushl $0.

Matthieu

#10 lore raw
In reply to matthieu castet
Quoted 10 lines · matthieu castet
Quoted 6 lines · Pavel Machek

Hmm, maybe I know where problem could be. Try

        movl     $(wakeup_stack - wakeup_code), %esp              # 

Private stack is needed for ASUS bo\

instead of existing stack setup. That helped on one of my test-boxes

Thanks, I will try that.
Because clearing the flags imply pop/push in the stack it could be the problem

That doesn't help : it still crash in pushl $0.

Matthieu

#11 lore raw

Hi,

Quoted 5 lines · matthieu castet
Quoted 4 lines · matthieu castet
Quoted 2 lines · Pavel Machek

Hmm, maybe I know where problem could be. Try

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
        movl     $(wakeup_stack - wakeup_code), %esp              # 

Private stack is needed for ASUS bo\

instead of existing stack setup. That helped on one of my test-boxes

Thanks, I will try that.
Because clearing the flags imply pop/push in the stack it could be the problem

That doesn't help : it still crash in pushl $0.

All stack stuff in wakeup_code crash for me.
I tried to change the stack position, make sure upper bit of %esp are clear, ... nothing work.
What's are strange is that according to my x86 manual, in real mode the failure can only happen if the stack wrap which is not the case here. Any x86 guru advice ?

If I remove stack access (remove clearing flag stuff, not call to video stuff) the resume works.

Matthieu

#12 lore raw
In reply to matthieu castet

Hi,

Quoted 5 lines · matthieu castet
Quoted 4 lines · matthieu castet
Quoted 2 lines · Pavel Machek

Hmm, maybe I know where problem could be. Try

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
        movl     $(wakeup_stack - wakeup_code), %esp              # 

Private stack is needed for ASUS bo\

instead of existing stack setup. That helped on one of my test-boxes

Thanks, I will try that.
Because clearing the flags imply pop/push in the stack it could be the problem

That doesn't help : it still crash in pushl $0.

All stack stuff in wakeup_code crash for me.
I tried to change the stack position, make sure upper bit of %esp are clear, ... nothing work.
What's are strange is that according to my x86 manual, in real mode the failure can only happen if the stack wrap which is not the case here. Any x86 guru advice ?

If I remove stack access (remove clearing flag stuff, not call to video stuff) the resume works.

Matthieu

#13 lore raw
Quoted 24 lines · matthieu castet

Hi,

Quoted 5 lines · matthieu castet
Quoted 4 lines · matthieu castet
Quoted 2 lines · Pavel Machek

Hmm, maybe I know where problem could be. Try

Quoted 9 lines
Quoted 7 lines
Quoted 4 lines
        movl     $(wakeup_stack - wakeup_code), %esp              # 

Private stack is needed for ASUS bo\

instead of existing stack setup. That helped on one of my test-boxes

Thanks, I will try that.
Because clearing the flags imply pop/push in the stack it could be the problem

That doesn't help : it still crash in pushl $0.

All stack stuff in wakeup_code crash for me.
I tried to change the stack position, make sure upper bit of %esp are clear, ... nothing work.
What's are strange is that according to my x86 manual, in real mode the failure can only happen if the stack wrap which is not the case here. Any x86 guru advice ?

Quoted 2 lines

If I remove stack access (remove clearing flag stuff, not call to video stuff) the resume works.

Hm, can you place a "pushl %eax; popl %eax;" in place of the removed code and see if that breaks?

Rafael

#14 lore raw
In reply to matthieu castet
Quoted 24 lines · matthieu castet

Hi,

Quoted 5 lines · matthieu castet
Quoted 4 lines · matthieu castet
Quoted 2 lines · Pavel Machek

Hmm, maybe I know where problem could be. Try

Quoted 9 lines
Quoted 7 lines
Quoted 4 lines
        movl     $(wakeup_stack - wakeup_code), %esp              # 

Private stack is needed for ASUS bo\

instead of existing stack setup. That helped on one of my test-boxes

Thanks, I will try that.
Because clearing the flags imply pop/push in the stack it could be the problem

That doesn't help : it still crash in pushl $0.

All stack stuff in wakeup_code crash for me.
I tried to change the stack position, make sure upper bit of %esp are clear, ... nothing work.
What's are strange is that according to my x86 manual, in real mode the failure can only happen if the stack wrap which is not the case here. Any x86 guru advice ?

Quoted 2 lines

If I remove stack access (remove clearing flag stuff, not call to video stuff) the resume works.

Hm, can you place a "pushl %eax; popl %eax;" in place of the removed code and see if that breaks?

Rafael

#15 lore raw
Quoted 21 lines · Rafael J. Wysocki
Quoted 20 lines · matthieu castet

Hi,

Quoted 4 lines · matthieu castet
Quoted 3 lines · matthieu castet
Quoted 2 lines · Pavel Machek

Hmm, maybe I know where problem could be. Try

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
        movl     $(wakeup_stack - wakeup_code), %esp              # 

Private stack is needed for ASUS bo\

instead of existing stack setup. That helped on one of my test-boxes

Thanks, I will try that.
Because clearing the flags imply pop/push in the stack it could be the problem

That doesn't help : it still crash in pushl $0.

All stack stuff in wakeup_code crash for me.
I tried to change the stack position, make sure upper bit of %esp are clear, ... nothing work.
What's are strange is that according to my x86 manual, in real mode the failure can only happen if the stack wrap which is not the case here. Any x86 guru advice ?

Quoted 4 lines
Quoted 1 line

If I remove stack access (remove clearing flag stuff, not call to video stuff) the resume works.

Hm, can you place a "pushl %eax; popl %eax;" in place of the removed code and see if that breaks?

Yes that also break.

Matthieu

#16 lore raw
In reply to Rafael J. Wysocki
Quoted 21 lines · Rafael J. Wysocki
Quoted 20 lines · matthieu castet

Hi,

Quoted 4 lines · matthieu castet
Quoted 3 lines · matthieu castet
Quoted 2 lines · Pavel Machek

Hmm, maybe I know where problem could be. Try

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
        movl     $(wakeup_stack - wakeup_code), %esp              # 

Private stack is needed for ASUS bo\

instead of existing stack setup. That helped on one of my test-boxes

Thanks, I will try that.
Because clearing the flags imply pop/push in the stack it could be the problem

That doesn't help : it still crash in pushl $0.

All stack stuff in wakeup_code crash for me.
I tried to change the stack position, make sure upper bit of %esp are clear, ... nothing work.
What's are strange is that according to my x86 manual, in real mode the failure can only happen if the stack wrap which is not the case here. Any x86 guru advice ?

Quoted 4 lines
Quoted 1 line

If I remove stack access (remove clearing flag stuff, not call to video stuff) the resume works.

Hm, can you place a "pushl %eax; popl %eax;" in place of the removed code and see if that breaks?

Yes that also break.

Matthieu

#17 lore raw

Hi!

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

instead of existing stack setup. That helped on one of my test-boxes

Thanks, I will try that.
Because clearing the flags imply pop/push in the stack it could be the problem

That doesn't help : it still crash in pushl $0.

All stack stuff in wakeup_code crash for me.
I tried to change the stack position, make sure upper bit of %esp are clear, ... nothing work.
What's are strange is that according to my x86 manual, in real mode the failure can only happen if the stack wrap which is not the case here. Any x86 guru advice ?

Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

If I remove stack access (remove clearing flag stuff, not call to video stuff) the resume works.

Hm, can you place a "pushl %eax; popl %eax;" in place of the removed code and see if that breaks?

Yes that also break.

Not sure what is going on... but if you remove all the stack references, does it go up to 32-bit mode?
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#18 lore raw
Quoted 21 lines · Pavel Machek

Hi!

Quoted 19 lines
Quoted 13 lines
Quoted 13 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

instead of existing stack setup. That helped on one of my test-boxes

Thanks, I will try that.
Because clearing the flags imply pop/push in the stack it could be the problem

That doesn't help : it still crash in pushl $0.

All stack stuff in wakeup_code crash for me.
I tried to change the stack position, make sure upper bit of %esp are clear, ... nothing work.
What's are strange is that according to my x86 manual, in real mode the failure can only happen if the stack wrap which is not the case here. Any x86 guru advice ?

Quoted 5 lines
Quoted 2 lines

If I remove stack access (remove clearing flag stuff, not call to video stuff) the resume works.

Hm, can you place a "pushl %eax; popl %eax;" in place of the removed code and see if that breaks?

Yes that also break.

Interesting.

Quoted 1 line

Not sure what is going on...

Looks like ss goes bonkers or the 32-bit opcodes are invalid in real mode.

Matthieu, can you try "pushw %ax; popw %ax;", please?

Rafael

#19 lore raw
In reply to Pavel Machek
Quoted 21 lines · Pavel Machek

Hi!

Quoted 19 lines
Quoted 13 lines
Quoted 13 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

instead of existing stack setup. That helped on one of my test-boxes

Thanks, I will try that.
Because clearing the flags imply pop/push in the stack it could be the problem

That doesn't help : it still crash in pushl $0.

All stack stuff in wakeup_code crash for me.
I tried to change the stack position, make sure upper bit of %esp are clear, ... nothing work.
What's are strange is that according to my x86 manual, in real mode the failure can only happen if the stack wrap which is not the case here. Any x86 guru advice ?

Quoted 5 lines
Quoted 2 lines

If I remove stack access (remove clearing flag stuff, not call to video stuff) the resume works.

Hm, can you place a "pushl %eax; popl %eax;" in place of the removed code and see if that breaks?

Yes that also break.

Interesting.

Quoted 1 line

Not sure what is going on...

Looks like ss goes bonkers or the 32-bit opcodes are invalid in real mode.

Matthieu, can you try "pushw %ax; popw %ax;", please?

Rafael

#20 lore raw

I have read somewhere that the problem appeared at the beginning of 2.6.24 development. I'm using pure 2.6.23 (sony vaio laptop) and I have experienced the problem of returning from suspend to ram as well. It always occurs when the battery is present in the slot and never without it. I did not have such problem with 2.6.19-rc3. I tried the 2.6.23-12 and 2.6.24 but without any better. If you need any details about my configuration write me please.
regards
cacy

#21 lore raw
In reply to matthieu castet

Hi!

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

instead of existing stack setup. That helped on one of my test-boxes

Thanks, I will try that.
Because clearing the flags imply pop/push in the stack it could be the problem

That doesn't help : it still crash in pushl $0.

All stack stuff in wakeup_code crash for me.
I tried to change the stack position, make sure upper bit of %esp are clear, ... nothing work.
What's are strange is that according to my x86 manual, in real mode the failure can only happen if the stack wrap which is not the case here. Any x86 guru advice ?

Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

If I remove stack access (remove clearing flag stuff, not call to video stuff) the resume works.

Hm, can you place a "pushl %eax; popl %eax;" in place of the removed code and see if that breaks?

Yes that also break.

Not sure what is going on... but if you remove all the stack references, does it go up to 32-bit mode?
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#22 lore raw
In reply to matthieu castet
Quoted 25 lines · matthieu castet
Quoted 24 lines · Rafael J. Wysocki
Quoted 23 lines · matthieu castet

Hi,

Quoted 4 lines · matthieu castet
Quoted 3 lines · matthieu castet
Quoted 2 lines · Pavel Machek

Hmm, maybe I know where problem could be. Try

Quoted 9 lines
Quoted 7 lines
Quoted 4 lines
        movl     $(wakeup_stack - wakeup_code), %esp              # 

Private stack is needed for ASUS bo\

instead of existing stack setup. That helped on one of my test-boxes

Thanks, I will try that.
Because clearing the flags imply pop/push in the stack it could be the problem

That doesn't help : it still crash in pushl $0.

All stack stuff in wakeup_code crash for me.
I tried to change the stack position, make sure upper bit of %esp are clear, ... nothing work.
What's are strange is that according to my x86 manual, in real mode the failure can only happen if the stack wrap which is not the case here. Any x86 guru advice ?

Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

If I remove stack access (remove clearing flag stuff, not call to video stuff) the resume works.

Hm, can you place a "pushl %eax; popl %eax;" in place of the removed code and see if that breaks?

Yes that also break.

Hmm, and what kind of machine is that?
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#23 lore raw
Quoted 7 lines · Pavel Machek
Quoted 4 lines · matthieu castet
Quoted 3 lines
Quoted 1 line

If I remove stack access (remove clearing flag stuff, not call to video stuff) the resume works.

Hm, can you place a "pushl %eax; popl %eax;" in place of the removed code and see if that breaks?

Yes that also break.

Hmm, and what kind of machine is that?

processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 6
model name : AMD Athlon(tm) XP 1800+
stepping : 2
cpu MHz : 1533.490
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow ts
bogomips : 3070.84
clflush size : 32

#24 lore raw
In reply to Pavel Machek
Quoted 7 lines · Pavel Machek
Quoted 4 lines · matthieu castet
Quoted 3 lines
Quoted 1 line

If I remove stack access (remove clearing flag stuff, not call to video stuff) the resume works.

Hm, can you place a "pushl %eax; popl %eax;" in place of the removed code and see if that breaks?

Yes that also break.

Hmm, and what kind of machine is that?

processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 6
model name : AMD Athlon(tm) XP 1800+
stepping : 2
cpu MHz : 1533.490
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow ts
bogomips : 3070.84
clflush size : 32

#25 lore raw

Hi!

Quoted 19 lines
Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

If I remove stack access (remove clearing flag stuff, not call to video stuff) the resume works.

Hm, can you place a "pushl %eax; popl %eax;" in place of the removed code and see if that breaks?

Yes that also break.

Hmm, and what kind of machine is that?

processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 6
model name : AMD Athlon(tm) XP 1800+
stepping : 2
cpu MHz : 1533.490
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no

Quoted 8 lines

fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow ts
bogomips : 3070.84
clflush size : 32

So I assume it is some kind of desktop?
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#26 lore raw
In reply to matthieu castet

Hi!

Quoted 19 lines
Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

If I remove stack access (remove clearing flag stuff, not call to video stuff) the resume works.

Hm, can you place a "pushl %eax; popl %eax;" in place of the removed code and see if that breaks?

Yes that also break.

Hmm, and what kind of machine is that?

processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 6
model name : AMD Athlon(tm) XP 1800+
stepping : 2
cpu MHz : 1533.490
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no

Quoted 8 lines

fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow ts
bogomips : 3070.84
clflush size : 32

So I assume it is some kind of desktop?
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#27 lore raw

Hi,

Quoted 2 lines · Pavel Machek

Hi!
So I assume it is some kind of desktop?

Yes.

Quoted 6 lines
Quoted 3 lines

...if someone calls start as 0x1234:0, we are okay. But if some broken bios calls us as 0x1:0x234, we've got a problem.

Well, in that case the signature/end_signature tests below would trigger, no?

Yes, and for example the beep flag won't work.

Quoted 3 lines

Not sure what is going on... but if you remove all the stack references, does it go up to 32-bit mode?

Yes, but I end up with a kernel panic after console resume and some resume stuff.

Quoted 2 lines

Looks like ss goes bonkers or the 32-bit opcodes are invalid in real mode. Matthieu, can you try "pushw %ax; popw %ax;", please?

I still crash.
I also try to set ss to 0, and hardcode the stack (knowing we are loaded at 0x1000). And it crash.

I wonder if there a way to check that we are realy in real mode ?

Matthieu

#28 lore raw
In reply to Pavel Machek

Hi,

Quoted 2 lines · Pavel Machek

Hi!
So I assume it is some kind of desktop?

Yes.

Quoted 6 lines
Quoted 3 lines

...if someone calls start as 0x1234:0, we are okay. But if some broken bios calls us as 0x1:0x234, we've got a problem.

Well, in that case the signature/end_signature tests below would trigger, no?

Yes, and for example the beep flag won't work.

Quoted 3 lines

Not sure what is going on... but if you remove all the stack references, does it go up to 32-bit mode?

Yes, but I end up with a kernel panic after console resume and some resume stuff.

Quoted 2 lines

Looks like ss goes bonkers or the 32-bit opcodes are invalid in real mode. Matthieu, can you try "pushw %ax; popw %ax;", please?

I still crash.
I also try to set ss to 0, and hardcode the stack (knowing we are loaded at 0x1000). And it crash.

I wonder if there a way to check that we are realy in real mode ?

Matthieu

#29 lore raw
Quoted 24 lines · matthieu castet

Hi,

Quoted 2 lines · Pavel Machek

Hi!
So I assume it is some kind of desktop?

Yes.

Quoted 6 lines
Quoted 3 lines

...if someone calls start as 0x1234:0, we are okay. But if some broken bios calls us as 0x1:0x234, we've got a problem.

Well, in that case the signature/end_signature tests below would trigger, no?

Yes, and for example the beep flag won't work.

Quoted 3 lines

Not sure what is going on... but if you remove all the stack references, does it go up to 32-bit mode?

Yes, but I end up with a kernel panic after console resume and some resume stuff.

Quoted 1 line

Looks like ss goes bonkers or the 32-bit opcodes are invalid in real

Quoted 8 lines

mode.

Quoted 1 line

Matthieu, can you try "pushw %ax; popw %ax;", please?

I still crash.
I also try to set ss to 0, and hardcode the stack (knowing we are loaded at 0x1000). And it crash.

I wonder if there a way to check that we are realy in real mode ?

Yes. In real mode bit 0 of the cr0 register should be 0.

Thanks,
Rafael

#30 lore raw
In reply to matthieu castet
Quoted 24 lines · matthieu castet

Hi,

Quoted 2 lines · Pavel Machek

Hi!
So I assume it is some kind of desktop?

Yes.

Quoted 6 lines
Quoted 3 lines

...if someone calls start as 0x1234:0, we are okay. But if some broken bios calls us as 0x1:0x234, we've got a problem.

Well, in that case the signature/end_signature tests below would trigger, no?

Yes, and for example the beep flag won't work.

Quoted 3 lines

Not sure what is going on... but if you remove all the stack references, does it go up to 32-bit mode?

Yes, but I end up with a kernel panic after console resume and some resume stuff.

Quoted 1 line

Looks like ss goes bonkers or the 32-bit opcodes are invalid in real

Quoted 8 lines

mode.

Quoted 1 line

Matthieu, can you try "pushw %ax; popw %ax;", please?

I still crash.
I also try to set ss to 0, and hardcode the stack (knowing we are loaded at 0x1000). And it crash.

I wonder if there a way to check that we are realy in real mode ?

Yes. In real mode bit 0 of the cr0 register should be 0.

Thanks,
Rafael

#31 lore raw
Quoted 3 lines
Quoted 1 line

I wonder if there a way to check that we are realy in real mode ?

Yes. In real mode bit 0 of the cr0 register should be 0.

It is not as simple. There's stuff like "unreal" mode... real mode with 4GB descriptor limits... and similar crazyness.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#32 lore raw
In reply to Rafael J. Wysocki
Quoted 3 lines
Quoted 1 line

I wonder if there a way to check that we are realy in real mode ?

Yes. In real mode bit 0 of the cr0 register should be 0.

It is not as simple. There's stuff like "unreal" mode... real mode with 4GB descriptor limits... and similar crazyness.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#33 lore raw
In reply to matthieu castet
Quoted 25 lines · matthieu castet
Quoted 24 lines · Rafael J. Wysocki
Quoted 23 lines · matthieu castet

Hi,

Quoted 4 lines · matthieu castet
Quoted 3 lines · matthieu castet
Quoted 2 lines · Pavel Machek

Hmm, maybe I know where problem could be. Try

Quoted 9 lines
Quoted 7 lines
Quoted 4 lines
        movl     $(wakeup_stack - wakeup_code), %esp              # 

Private stack is needed for ASUS bo\

instead of existing stack setup. That helped on one of my test-boxes

Thanks, I will try that.
Because clearing the flags imply pop/push in the stack it could be the problem

That doesn't help : it still crash in pushl $0.

All stack stuff in wakeup_code crash for me.
I tried to change the stack position, make sure upper bit of %esp are clear, ... nothing work.
What's are strange is that according to my x86 manual, in real mode the failure can only happen if the stack wrap which is not the case here. Any x86 guru advice ?

Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

If I remove stack access (remove clearing flag stuff, not call to video stuff) the resume works.

Hm, can you place a "pushl %eax; popl %eax;" in place of the removed code and see if that breaks?

Yes that also break.

Hmm, and what kind of machine is that?
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#34 lore raw
In reply to matthieu castet

Hi!

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 6 lines

Hmm, maybe I know where problem could be. Try

        movl     $(wakeup_stack - wakeup_code), %esp              # 

Private stack is needed for ASUS bo\

instead of existing stack setup. That helped on one of my test-boxes

Thanks, I will try that.
Because clearing the flags imply pop/push in the stack it could be the problem

Quoted 8 lines
Quoted 2 lines

That doesn't help : it still crash in pushl $0.

All stack stuff in wakeup_code crash for me.
I tried to change the stack position, make sure upper bit of %esp are clear, ... nothing work.
What's are strange is that according to my x86 manual, in real mode the failure can only happen if the stack wrap which is not the case here. Any x86 guru advice ?

Could you try the .c wakeup? I changed it a bit, perhaps that's enough.

Quoted 2 lines

If I remove stack access (remove clearing flag stuff, not call to video stuff) the resume works.

Actually, I see a possible problem:

_start:

        cli
        cld

        /* Set up segments */
        movw    %cs,%ax
        movw    %ax,%ds
        movw    %ax,%es
        movw    %ax,%ss

        movl    $wakeup_stack_end, %esp

        /* Clear the EFLAGS */
        pushl   $0
        popfl

...if someone calls start as 0x1234:0, we are okay. But if some broken bios calls us as 0x1:0x234, we've got a problem.

One possible hack would be to movl 0, %esp. That should put the stack at _start, corrupting memory but hopefully helping you diagnose it.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#35 lore raw
In reply to matthieu castet

Hi!

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 6 lines

Hmm, maybe I know where problem could be. Try

        movl     $(wakeup_stack - wakeup_code), %esp              # 

Private stack is needed for ASUS bo\

instead of existing stack setup. That helped on one of my test-boxes

Thanks, I will try that.
Because clearing the flags imply pop/push in the stack it could be the problem

Quoted 8 lines
Quoted 2 lines

That doesn't help : it still crash in pushl $0.

All stack stuff in wakeup_code crash for me.
I tried to change the stack position, make sure upper bit of %esp are clear, ... nothing work.
What's are strange is that according to my x86 manual, in real mode the failure can only happen if the stack wrap which is not the case here. Any x86 guru advice ?

Could you try the .c wakeup? I changed it a bit, perhaps that's enough.

Quoted 2 lines

If I remove stack access (remove clearing flag stuff, not call to video stuff) the resume works.

Actually, I see a possible problem:

_start:

        cli
        cld

        /* Set up segments */
        movw    %cs,%ax
        movw    %ax,%ds
        movw    %ax,%es
        movw    %ax,%ss

        movl    $wakeup_stack_end, %esp

        /* Clear the EFLAGS */
        pushl   $0
        popfl

...if someone calls start as 0x1234:0, we are okay. But if some broken bios calls us as 0x1:0x234, we've got a problem.

One possible hack would be to movl 0, %esp. That should put the stack at _start, corrupting memory but hopefully helping you diagnose it.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#36 lore raw
Quoted 1 line · Pavel Machek

Hi!

Hi,

Quoted 41 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 6 lines

Hmm, maybe I know where problem could be. Try

        movl     $(wakeup_stack - wakeup_code), %esp              # 

Private stack is needed for ASUS bo\

instead of existing stack setup. That helped on one of my test-boxes

Thanks, I will try that.
Because clearing the flags imply pop/push in the stack it could be the problem

Quoted 8 lines
Quoted 2 lines

That doesn't help : it still crash in pushl $0.

All stack stuff in wakeup_code crash for me.
I tried to change the stack position, make sure upper bit of %esp are clear, ... nothing work.
What's are strange is that according to my x86 manual, in real mode the failure can only happen if the stack wrap which is not the case here. Any x86 guru advice ?

Could you try the .c wakeup? I changed it a bit, perhaps that's enough.

Quoted 2 lines

If I remove stack access (remove clearing flag stuff, not call to video stuff) the resume works.

Actually, I see a possible problem:

_start:

        cli
        cld

        /* Set up segments */
        movw    %cs,%ax
        movw    %ax,%ds
        movw    %ax,%es
        movw    %ax,%ss

        movl    $wakeup_stack_end, %esp

        /* Clear the EFLAGS */
        pushl   $0
        popfl
Quoted 2 lines

...if someone calls start as 0x1234:0, we are okay. But if some broken bios calls us as 0x1:0x234, we've got a problem.

Well, in that case the signature/end_signature tests below would trigger, no?

Rafael

#37 lore raw
In reply to Pavel Machek
Quoted 1 line · Pavel Machek

Hi!

Hi,

Quoted 41 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 6 lines

Hmm, maybe I know where problem could be. Try

        movl     $(wakeup_stack - wakeup_code), %esp              # 

Private stack is needed for ASUS bo\

instead of existing stack setup. That helped on one of my test-boxes

Thanks, I will try that.
Because clearing the flags imply pop/push in the stack it could be the problem

Quoted 8 lines
Quoted 2 lines

That doesn't help : it still crash in pushl $0.

All stack stuff in wakeup_code crash for me.
I tried to change the stack position, make sure upper bit of %esp are clear, ... nothing work.
What's are strange is that according to my x86 manual, in real mode the failure can only happen if the stack wrap which is not the case here. Any x86 guru advice ?

Could you try the .c wakeup? I changed it a bit, perhaps that's enough.

Quoted 2 lines

If I remove stack access (remove clearing flag stuff, not call to video stuff) the resume works.

Actually, I see a possible problem:

_start:

        cli
        cld

        /* Set up segments */
        movw    %cs,%ax
        movw    %ax,%ds
        movw    %ax,%es
        movw    %ax,%ss

        movl    $wakeup_stack_end, %esp

        /* Clear the EFLAGS */
        pushl   $0
        popfl
Quoted 2 lines

...if someone calls start as 0x1234:0, we are okay. But if some broken bios calls us as 0x1:0x234, we've got a problem.

Well, in that case the signature/end_signature tests below would trigger, no?

Rafael

#38 lore raw
In reply to Rafael J. Wysocki
Quoted 24 lines · Rafael J. Wysocki
Quoted 23 lines · matthieu castet
Quoted 9 lines · matthieu castet

Hi,

I am trying to make work suspend to ram on a MSI MS-6380E with a 2.6.23 kernel.

Standby mode works.
S2ram suspend seems to work : the computer turn off and I can wake up it with the keyboard.

Quoted 8 lines

But when the computer wakeup, I see the video card POST on the screen, but after that the computer hangs : black screen, no working numlock.

I tried to compile PM_TRACE, but it give no result. So this means the resume hang very early.

What can I do to debug this ?

I play with the s2_beep feature and :
- echo 4 > /proc/sys/kernel/acpi_video_flags make the computer beep
- echo 4 > /proc/sys/kernel/acpi_video_flags make the computer not beep
- adding a beep in bogus_real_magic, make the computer not beep

Quoted 4 lines
Quoted 1 line

So the hang seems located in wakeup_start.

Hm. Can you add unconditional BEEP after "jne bogus_real_magic" in arch/x86/kernel/acpi/wakeup.S and see if it beeps?

Hmm, maybe I know where problem could be. Try

        movl     $(wakeup_stack - wakeup_code), %esp              # Private stack is needed for ASUS bo\

instead of existing stack setup. That helped on one of my test-boxes -- I uncovered that during rewrite.

Otherwise use BEEP and infinite loops to find out where it hangs...

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html