Bug 4455 - S3 resume: console lockup - ThinkPad R51 2883ELU
Summary: S3 resume: console lockup - ThinkPad R51 2883ELU
Status: REJECTED UNREPRODUCIBLE
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Sleep-Wake (show other bugs)
Hardware: i386 Linux
: P2 high
Assignee: Venkatesh Pallipadi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-07 07:38 UTC by Andrew Barr
Modified: 2007-09-06 14:45 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.9-2.6.11.6,also 2.6.12-rc1-mm3
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
kernel configuration for 2.6.11.6 (35.97 KB, text/plain)
2005-04-07 07:40 UTC, Andrew Barr
Details
dmidecode output (12.88 KB, text/plain)
2005-04-07 07:41 UTC, Andrew Barr
Details
disassembled DSDT (355.84 KB, text/plain)
2005-04-07 07:42 UTC, Andrew Barr
Details
'lspci -vvv' before s3 (9.73 KB, text/plain)
2005-04-07 07:43 UTC, Andrew Barr
Details
'lspci -vvv' after s3 (9.70 KB, text/plain)
2005-04-07 07:46 UTC, Andrew Barr
Details
dmesg after s3 (15.13 KB, text/plain)
2005-04-07 07:47 UTC, Andrew Barr
Details
sleep.conf file for swsusp2 hibernate script (4.60 KB, text/plain)
2005-04-07 07:48 UTC, Andrew Barr
Details
biosdecode output (1.36 KB, text/plain)
2005-04-07 07:49 UTC, Andrew Barr
Details

Description Andrew Barr 2005-04-07 07:38:48 UTC
Distribution: Gentoo Linux 2004.3, Fedora Core 3 (tested)    
    
Hardware Environment:     
IBM ThinkPad R51 2883ELU    
EC Program Versions Tested: 1.02-1.04    
BIOS Versions Tested: 1.16,1.17,1.20 (shipped),1.21    
    
Software Environment:    
Kernels tested: kernel.org 2.6.9 through 2.6.11.6; ACPI 20050303, 20050309;  
also tested   
2.6.12-rc1-mm3 and stock FC3 kernel (whatever's on the DVD).   
    
Problem Description:    
After suspend-to-RAM, the display powers up (in the case of the LCD backlight    
is on, if attached and activated the CRT is woken up), but the console is   
frozen at it's state prior to S3.    
If acpi_sleep=s3_mode is used, the keyboard and mouse work, can type commands   
at a bash prompt, ssh works. No workaround I've seen to date resolves this    
issue. I've tried:    
    
- acpi_sleep=s3_bios. Display starts but computer freezes completely 
(half-moon LED never goes off).    
- video_post. Has no discernable effect after S3 (does before), if run over    
SSH it simply never returns (must kill it via Ctrl+C).    
- vbetool. Similar to video_post.    
- init=/bin/bash. No different behavior than if suspending from X11, except   
that you can type commands blind at the prompt.   
- UseDummyXServer and SwitchToTextMode options on the Software Suspend 2 
hibernate script. 
 
If suspending from X11, the presence of the AGP and DRI modules for this 
machine (intel_agp, i915, and agpgart) make the machine freeze (half-moon LED 
stays on). 
    
Steps to reproduce: 
1. boot into X11. 
2. 'hibernate -F/etc/hibernate/sleep.conf' (sleep.conf attachment following 
this message) 
3. resume machine (either by lid switch, power button, or sleep button 
(Fn+F4)). 
4. observe frozen console
Comment 1 Andrew Barr 2005-04-07 07:40:12 UTC
Created attachment 4872 [details]
kernel configuration for 2.6.11.6
Comment 2 Andrew Barr 2005-04-07 07:41:20 UTC
Created attachment 4873 [details]
dmidecode output
Comment 3 Andrew Barr 2005-04-07 07:42:40 UTC
Created attachment 4874 [details]
disassembled DSDT

compiles back w/o errors.
Comment 4 Andrew Barr 2005-04-07 07:43:49 UTC
Created attachment 4875 [details]
'lspci -vvv' before s3
Comment 5 Andrew Barr 2005-04-07 07:46:04 UTC
Created attachment 4876 [details]
'lspci -vvv' after s3
Comment 6 Andrew Barr 2005-04-07 07:47:09 UTC
Created attachment 4877 [details]
dmesg after s3
Comment 7 Andrew Barr 2005-04-07 07:48:18 UTC
Created attachment 4878 [details]
sleep.conf file for swsusp2 hibernate script
Comment 8 Andrew Barr 2005-04-07 07:49:03 UTC
Created attachment 4879 [details]
biosdecode output
Comment 9 Andrew Barr 2005-04-12 15:52:02 UTC
Under 2.6.12-rc2-mm3, the computer reboots after resume from S3 either with no 
acpi_sleep parameter or acpi_sleep=s3_mode. 
Comment 10 Shaohua 2005-04-12 19:07:04 UTC
2.6.12-rc2-mm3 has a bug for gdt load, which cause any system reboots at 
resume. I have reported this to Len. Revert below patch will help you.

diff -Nru a/arch/i386/kernel/acpi/sleep.c b/arch/i386/kernel/acpi/sleep.c
--- a/arch/i386/kernel/acpi/sleep.c	2004-10-15 11:29:15.000000000 +0900
+++ b/arch/i386/kernel/acpi/sleep.c	2004-10-19 00:59:32.000000000 +0900
@@ -17,7 +17,7 @@
 
 extern void zap_low_mappings(void);
 
-extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long));
+extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long,unsigned 
long));
 
 static void init_low_mapping(pgd_t *pgd, int pgd_limit)
 {
@@ -41,7 +41,8 @@
 		return 1;
 	init_low_mapping(swapper_pg_dir, USER_PTRS_PER_PGD);
 	memcpy((void *) acpi_wakeup_address, &wakeup_start, &wakeup_end - 
&wakeup_start);
-	acpi_copy_wakeup_routine(acpi_wakeup_address);
+	acpi_copy_wakeup_routine(acpi_wakeup_address,
+				 virt_to_phys((void *)acpi_wakeup_address));
 
 	return 0;
 }
diff -Nru a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S
--- a/arch/i386/kernel/acpi/wakeup.S	2004-08-14 14:36:31.000000000 +0900
+++ b/arch/i386/kernel/acpi/wakeup.S	2004-10-19 05:24:42.000000000 +0900
@@ -89,6 +89,7 @@
 real_magic:	.long 0
 video_mode:	.long 0
 video_flags:	.long 0
+real_gdt_table: .fill GDT_ENTRIES, 8, 0
 
 bogus_real_magic:
 	movw	$0x0e00 + 'B', %fs:(0x12)
@@ -213,6 +214,7 @@
 #
 # Parameters:
 # %eax:	place to copy wakeup routine to
+# %edx: the second argument (physical address)
 #
 # Returned address is location of code in low memory (past data and stack)
 #
@@ -223,6 +225,9 @@
 	sldt	saved_ldt
 	str	saved_tss
 
+	# save wakeup_start physical address in ecx
+	movl	%edx, %ecx
+
 	movl    %cr3, %edx
 	movl    %edx, real_save_cr3 - wakeup_start (%eax)
 	movl    %cr4, %edx
@@ -231,6 +236,16 @@
 	movl	%edx, real_save_cr0 - wakeup_start (%eax)
 	sgdt    real_save_gdt - wakeup_start (%eax)
 
+	# gdt body must be addressable from real mode by
+	# copying it to the lower mem
+	lea     real_gdt_table - wakeup_start (%ecx), %ecx
+	movl    %ecx, real_save_gdt + 2 - wakeup_start (%eax)
+	xor     %ecx, %ecx
+	movw    saved_gdt, %cx
+	movl    saved_gdt + 2, %esi
+	lea     real_gdt_table - wakeup_start (%eax), %edi
+	rep movsb
+
 	movl	saved_videomode, %edx
 	movl	%edx, video_mode - wakeup_start (%eax)
 	movl	acpi_video_flags, %edx
Comment 11 Andrew Barr 2005-04-13 05:18:51 UTC
It seems that the problem of a frozen console is related to the graphics 
device being put into D3 (perhaps by the BIOS), but not being put back into D0 
for lack of a kernel driver. Saving the config space to disk and restoring it 
after suspend returns me to the bash prompt. See my recent posting to this 
acpi-devel thread for a description of the commands I used: "i855-based 
ThinkPad STR: Graphics device stays in D3 after resume" (hasn't been archived 
by Sourceforge or Gmane yet). I have not tested this within X yet. 
Comment 12 Len Brown 2005-08-17 12:20:09 UTC
still an issue with 2.6.13?
Comment 13 Andrew Barr 2005-08-18 09:40:35 UTC
It is still necessary to run the following command before suspend, where the
video hardware sits at PCI 00:02.0 :

cat /proc/bus/pci/00/02.0 > /var/cache/vidpci.config

and then this command after the computer wakes up:

cat /var/cache/vidpci.config > /proc/bus/pci/00/02.0

Tested 2.6.13-rc6-git9.
Comment 14 Len Brown 2007-08-18 14:47:05 UTC
Andrew, is this still failing with a recent kernel
and a recent distribution (ie. version of X)?

BTW. Some have asserted that acpi_sleep=s3_bios is always
a good idea on Intel integrated video hardware,
but your observations seem to show that it may
actually make things worse on this system --
at least with the version of the kernel tested.
Comment 15 Len Brown 2007-09-06 14:45:39 UTC
please re-open if this is still a problem in linux-2.6.22.stable or later

Note You need to log in before you can comment on or make changes to this bug.