Bug 11658

Summary: shutdown on A/C removal - Samsung R510 Laptop
Product: ACPI Reporter: Mike Lothian (mike)
Component: BIOSAssignee: acpi_bios
Status: CLOSED DOCUMENTED    
Severity: normal CC: acpi-bugzilla, akpm, lenb, yakui.zhao
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.26 2.6.27 linux-next mm Subsystem:
Regression: No Bisected commit-id:
Attachments: Dmesg Output
lspci -vvxxx output
acpidump output
/var/log/messages snippet
Screenshot before crash
ACPI output when unplugging and replugging power
meminfo 4g
No mem parm passed

Description Mike Lothian 2008-09-27 05:37:14 UTC
Latest working kernel version:Unknown
Earliest failing kernel version: 2.6.26
Distribution: Gentoo & Ubuntu
Hardware Environment: Samsung R510
Problem Description:

X will not start when ACPI Video is loaded, system freezes (can't ssh) no entrys in messages upon reboot

When ACPI Video isn't compiled in to the kernel X loads fine however when the A/C is removed (or inserted if booted from battery) laptop will freeze

I've tried stock 2.6.26 2.6.27-rc5 2.6.27-rc7 2.6.27-rc5-mm1 the latest linux-next

I've looked at bugs 9614 10448 & 10683 which seem to have similar issues except the A/C one

I tried mm and linux next to try the video_detect code but ACPI Video still doesn't work

Steps to reproduce: 

Either
Start X with ACPI Video 

Or
When ACPI Video isn't compiled remove A/C
Comment 1 Mike Lothian 2008-09-27 05:38:19 UTC
Created attachment 18065 [details]
Dmesg Output
Comment 2 Mike Lothian 2008-09-27 05:39:30 UTC
Created attachment 18066 [details]
lspci -vvxxx output
Comment 3 Mike Lothian 2008-09-27 05:40:27 UTC
Created attachment 18067 [details]
acpidump output
Comment 4 Mike Lothian 2008-09-27 06:01:55 UTC
Just to clarify the A/C problem happens when X is loaded and when it hasn't been

The laptop survives the power being pulled it's when the A/C is reinserted the problem occurs

I think I've found the problem in my /var/log/messages and I'm attaching the snippet 

I'll retest again and take a picture of the syslog on screen when it happens as I'm sure there was mention of an unstable clock
Comment 5 Mike Lothian 2008-09-27 06:02:37 UTC
Created attachment 18068 [details]
/var/log/messages snippet
Comment 6 Mike Lothian 2008-09-27 06:27:12 UTC
My laptop only survived the unplugging once out of 4 attempts the screen thene goes blank and it reboots

When it did survive I took the following snapshot

I think that's all the info you'll need, if not let me know 

I'm prepaired to switch on debugging and even set up netconsole if required
Comment 7 Mike Lothian 2008-09-27 06:30:51 UTC
Created attachment 18070 [details]
Screenshot before crash
Comment 8 Zhang Rui 2008-09-27 18:01:01 UTC
so there are two problems here:
1. X can not be loaded when acpi video driver loaded first.
2. X freezes when unplugging AC.
right?

for the first issue,
1. what if you echo 0 >/proc/acpi/video/*/DOS before starting X?
2. after applying the video_detect code, what if boot with "acpi_backlight=vendor"?

for the second issue,
please compile in the ACPI processor driver, and boot with "processor.max_cstate=1".
Comment 9 Mike Lothian 2008-09-27 20:51:25 UTC
For the first issue

1)

If ACPI Video is compiled as a module the laptop crashes as soon as it's loaded when it's compiled in it crashed when X is loaded

2)

When doing this the first time the kernel Paniced the rest of the time it behaves as above

Second issue

Again the kernel can panic, when it doesn't the laptop still crashed in removal of the A/C
Comment 10 Andrew Morton 2008-10-02 23:24:03 UTC
> 2.6.26  2.6.27 linux-next mm

and

> Earliest failing kernel version: 2.6.26

Confusing.  Was 2.6.26 OK or not?

Thanks.
Comment 11 Mike Lothian 2008-10-03 08:54:40 UTC
2.6.26 had this issue

This was the earliest kernel I tried

Should I try an earlier kernel?
Comment 12 Mike Lothian 2008-10-17 05:34:51 UTC
Is there any other info you'd like to try and diagnose this?
Comment 13 Len Brown 2008-10-17 10:05:02 UTC
Lets focus on one issue in this bug report -- the simpler
and more dramatic issue that when you pull out the A/C,
your system shuts down.  Lets move the video/X issue
to another bug report, okay?  At the end of the day
the two may be related, but buttons & events should
be easier to debug than video.

The log in comment #5 shows that you are receiving a power button event
and the system is executing a graceful shutdown:

Sep 27 13:42:23 tau acpid: received event "button/power PWRF 00000080 00000001"
Sep 27 13:42:23 tau acpid: notifying client 1841[103:1002]
Sep 27 13:42:23 tau acpid: notifying client 2001[0:0]
Sep 27 13:42:23 tau acpid: client has disconnected
Sep 27 13:42:23 tau acpid: executing action "/etc/acpi/default.sh button/power PWRF 00000080 00000001"
Sep 27 13:42:23 tau init: Switching to runlevel: 0


Lets test your power button...
Please kill acpid and cat /proc/acpi/event

then press the power button, the sleep button, the lid button, and any other buttons you might have and observe what comes out on the screen.
Then switch between AC and DC a few times and report what you see.

Also,
grep . /sys/firmware/acpi/interrupts/*
between each physical event to see if you can identify which buttons & switches
map to which low-level ACPI events.
Note that you can clear these stats between tests like so:
# echo 0 > /sys/firmware/acpi/interrupts/sci
Comment 14 Mike Lothian 2008-10-18 09:12:47 UTC
I was testing out the the latest patches in Linus's tree and noticed an option

 Reserve low 64K of RAM on AMI/Phoenix BIOSen  

I activated it and low and behold I can now unplug my laptop without it crashing :D

ACPI video still crashes the machine. So yes 2 bugs - unrelated (probably)

This is a fresh Gentoo install (yes the old kernels still do crash it) but I'll test everything else once I've got a fully installed system

Is there anything else in particular you'd like me to do to figure out the ACPI video problem?
Comment 15 Mike Lothian 2008-10-26 09:38:14 UTC
Created attachment 18451 [details]
ACPI output when unplugging and replugging power

This is the ACPI output when I plug and then unplug the power under 2.6.28-rc1

ACPI video still cannot be loaded without rebooting the system
Comment 16 Mike Lothian 2008-10-26 09:42:41 UTC
Would you like a separate bug for the ACPI Video issue or are you happy to use this one now the power issue is sorted?
Comment 17 Zhang Rui 2008-10-30 00:29:27 UTC
(In reply to comment #14)
> I was testing out the the latest patches in Linus's tree and noticed an
> option
> 
>  Reserve low 64K of RAM on AMI/Phoenix BIOSen  
> 
> I activated it and low and behold I can now unplug my laptop without it
> crashing :D
> 
do you mean this option fixes the problem for you?

(In reply to comment #16)
> Would you like a separate bug for the ACPI Video issue or are you happy to
> use
> this one now the power issue is sorted?
> 
Yes, we are closing to the rootcause of the shutdown problem.
please open another bug for the video issue.
Comment 18 Zhang Rui 2008-11-24 22:40:31 UTC
ping Mike,
please verify if the problem is fixed in the latest kernel.
Comment 19 Mike Lothian 2008-11-25 13:57:07 UTC
The crash / reboot on AC removal is fixed in the RC kernels

The good news is with this patch and the new ACPI code in the last RC video can be loaded without causing a crash. Now it only crashed with X is loaded

The strange thing is I can load it if I start X first then modprobe the module

What info would you like to help diagnose this?
Comment 20 Mike Lothian 2008-11-25 13:58:37 UTC
Oh yes meant to say that the brightness keys don't change the brightness whether the module is loaded or not or if X is loaded or not but I guess this could be a  configuration issue

My last laptop changed the brightness no matter what was loaded

Mike
Comment 21 Zhang Rui 2008-11-25 17:34:15 UTC
okay.
close this bug as the problem is fixed in the RC kernels.

For the video issue, it should be "system crashes when starting X with video driver loaded", right? please open another bug.
And please provide this info:
1. in console mode, attach the dmesg output after loading the video driver.
2. attach the result of "grep . /proc/acpi/video/*/*" and "grep /sys/class/backlight/*/*" after loading the video driver.
3. poking these files (if there are any) to try to change the backlight, can you change the backlight successfully? does the system crash?
4. attach the screenshot when system crashes.
Comment 22 Mike Lothian 2008-11-26 12:58:32 UTC
New bug created
Comment 23 Mike Lothian 2009-06-09 22:49:10 UTC
The only way to fix this for real is to use the boot parm mem=4096M but it mean's 1GB of RAM is unavailable

Other Samsung laptops have been fixed by updating to newer BIOSs however the R510 hasn't had any new releases
Comment 24 ykzhao 2009-06-18 09:51:58 UTC
Hi, Rui
    How about close one of 11658/12106?
    It seems that they are the duplicated bug.
    Thanks.
Comment 25 Zhang Rui 2009-07-06 03:47:51 UTC
no ,they are different bugs and I asked him to open a new bug for each issue.
Now it seems they can be fixed by the same workaround, but we still need to keep them open until we get the rootcause.
Comment 26 Zhang Rui 2009-07-30 06:56:49 UTC
please try this patch and see if it helps
http://patchwork.kernel.org/patch/38246/
Comment 27 Zhang Rui 2009-09-18 02:24:23 UTC
so this patch doesn't help on this issue neither, right?
Comment 28 Zhang Rui 2009-09-18 02:25:41 UTC
what about this boot option, "nosmp"?
Comment 29 Zhang Rui 2009-09-18 02:45:57 UTC
please attach the output of "cat /proc/meminfo"
Comment 30 Mike Lothian 2009-09-21 23:06:47 UTC
Created attachment 23135 [details]
meminfo 4g

This is /proc/meminfo with the boot parm mem=4g will try without this and also with nosmp as requested
Comment 31 Zhang Rui 2009-09-22 00:57:00 UTC
do you know the physical memory size of your laptop?
Comment 32 Mike Lothian 2009-09-22 01:22:56 UTC
Created attachment 23136 [details]
No mem parm passed

This is the same info but without mem=4g being passed, this makes my laptop nearly useless with and without the nosmp option
Comment 33 Mike Lothian 2009-09-22 01:23:26 UTC
The physical memory size for this laptop is 4g
Comment 34 Zhang Rui 2009-09-28 03:17:16 UTC
*** Bug 12106 has been marked as a duplicate of this bug. ***
Comment 35 Zhang Rui 2009-09-28 03:23:12 UTC
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009e400 (usable)
 BIOS-e820: 000000000009e400 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000dc000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 00000000bd6a1000 (usable)
 BIOS-e820: 00000000bd6a1000 - 00000000bd6a7000 (reserved)
 BIOS-e820: 00000000bd6a7000 - 00000000bd7b4000 (usable)
 BIOS-e820: 00000000bd7b4000 - 00000000bd80f000 (reserved)
 BIOS-e820: 00000000bd80f000 - 00000000bd907000 (usable)
 BIOS-e820: 00000000bd907000 - 00000000bdb0f000 (reserved)
 BIOS-e820: 00000000bdb0f000 - 00000000bdb18000 (usable)
 BIOS-e820: 00000000bdb18000 - 00000000bdb1f000 (reserved)
 BIOS-e820: 00000000bdb1f000 - 00000000bdb64000 (usable)
 BIOS-e820: 00000000bdb64000 - 00000000bdb9f000 (ACPI NVS)
 BIOS-e820: 00000000bdb9f000 - 00000000bdc00000 (ACPI data)
 BIOS-e820: 0000000100000000 - 0000000140000000 (usable)

You have 4G physical memory on your laptop. but the BIOS e820 table exports 5G avaiable memory.
this explains why mem=4G workarounds the problem for you.
So this is a BIOS bug, and this can only be fixed by BIOS upgrade.
Mike,
please verify if there is any BIOS upgrade for this laptop.
If not, I think you can raise this problem to samsung.
Comment 36 Mike Lothian 2009-09-28 04:02:31 UTC
Hi

Still no BIOS upgrade from Samsung, They were made aware of these bugs a very long time ago but insist that only 32bit Vista is supported (which of course works)

Is there any other way to get the other gig of ram working?

I think this laptop will be getting replaced with a new i7 soon anyway but I'd be nice to get everything all working before it's given to someone else to suffer

Mike
Comment 37 Zhang Rui 2009-09-28 05:30:42 UTC
(In reply to comment #36)
> Hi
> 
> Still no BIOS upgrade from Samsung, They were made aware of these bugs a very
> long time ago but insist that only 32bit Vista is supported (which of course
> works)
> 
> Is there any other way to get the other gig of ram working?
> 
there is no the other gig of ram.
there are 4G in all, but BIOS tells the OS that we have 5G.
so the error occurs when OS tries to access the memory higher than 4G.


> I think this laptop will be getting replaced with a new i7 soon anyway but
> I'd
> be nice to get everything all working before it's given to someone else to
> suffer
> 
IMO, before the bug being fixed by BIOS, using "mem=4096M" is an acceptable workaround for now.
Comment 38 Mike Lothian 2009-09-30 00:03:29 UTC
When I boot with mem=4g I dont get all my 4gigs of RAM I get 3050020kb ie 3gigs
Comment 39 Mike Lothian 2009-11-05 00:45:22 UTC
Is there no way to get all 4 gigs of memory working?
Comment 40 Mike Lothian 2009-11-16 01:02:58 UTC
Good news thanks to Windows 7 requiring 64bit to get the Win7 seal of approval Samsung has now put out an updated (and fixed) BIOS!!