Bug 5904
Summary: | wrong state of laptop lid on startup | ||
---|---|---|---|
Product: | ACPI | Reporter: | Fabian Zeindl (fabian) |
Component: | Other | Assignee: | Zhang Rui (rui.zhang) |
Status: | REJECTED INSUFFICIENT_DATA | ||
Severity: | normal | CC: | acpi-bugzilla, bunk |
Priority: | P2 | ||
Hardware: | i386 | ||
OS: | Linux | ||
Kernel Version: | 2.6.15 | Subsystem: | |
Regression: | --- | Bisected commit-id: | |
Attachments: |
acpidump
get LID state earlier Dmesg output with patch new dsdt |
Description
Fabian Zeindl
2006-01-16 08:14:31 UTC
>Checking 'hlt' instruction... OK.
> ACPI-0284: *** Info: Table [DSDT] replaced by host OS
Please re-test without overriding DSDT.
I've tested it without overriding. Same result... Please verify that this is still a problem with a recent kernel, such as 2.6.17.stable or 2.6.18-rc Hi, I run 2.6.17.7 and still have this problem on my laptop. please have a look at bug 5809 shown in http://bugzilla.kernel.org/show_bug.cgi?id=5809, and make sure whether you've got the same problem.:) If not, please make the test that Len Brown asked in #1, that will be helpful.:) I did the test: 1. When you boot the system with the lid open, what does state say? # cat /proc/acpi/button/lid/LID0/state state: closed 2. When you then press the lid button down (or actually close the lid and check the state from a serial console or network connection) what does state say? # cat /proc/acpi/button/lid/LID0/state state: closed 3. when you release or open the lid, what does state say? # cat /proc/acpi/button/lid/LID0/state state: open I dont't think I have the same problem, because after I closed the lid once everything is working perfectly fine. I don't have problems like I have to wait 20 seconds to change the status or things like that. Please attach your acpidump output.:) Created attachment 8847 [details]
acpidump
Created attachment 8850 [details]
get LID state earlier
Maybe OS gets a wrong LID state by evaluate "_LID" method. So i try to get the
LID state at an earlier time. if the state still shows "closed". i think this
is probably caused by a bios bug. Please try this patch and attach dmesg
again:)
Rui, Looking at the DSDT... Device (LID) { Name (_HID, EisaId ("PNP0C0D")) Method (_LID, 0, NotSerialized) { If (LIDS) { Return (0x01) } Else { Return (0x00) } } Name (_PRW, Package (0x02) { 0x18, 0x03 }) } and LIDS is defined here: OperationRegion (MNVS, SystemMemory, 0x0EEEBF09, 0x40) Field (MNVS, AnyAcc, Lock, Preserve) { OSYS, 16, SMIF, 8, PRM0, 8, PRM1, 8, SCIF, 8, PRM2, 8, PRM3, 8, LCKF, 8, PRM4, 8, PRM5, 8, DBGS, 8, DCKS, 4, CDCK, 4, FPEN, 8, FPST, 8, LIDS, 8, PWRS, 8, and LIDS is accessed here: Method (_Q2E, 0, NotSerialized) { Store (0x2E, P80H) If (LEqual (\_SB.PCI0.LPCB.EC.P54, 0x00)) { Store (0x98, \_SB.PCI0.LPCB.EC.P54S) Store (0x00, LIDS) } Else { Store (0x88, \_SB.PCI0.LPCB.EC.P54S) Store (0x01, LIDS) } Notify (\_SB.LID, 0x80) } Which is an Embedded Controller event handler. and P54 is defined here: OperationRegion (ERAM, EmbeddedControl, 0x00, 0x7F) Field (ERAM, AnyAcc, Lock, Preserve) { Offset (0x01), SCIC, 8, Offset (0x04), CMCD, 8, DAT1, 8, DAT2, 8, DAT3, 8, Offset (0x18), SMPR, 8, SMST, 8, SMAD, 8, SMCM, 8, SMD0, 264, SMAA, 8, Offset (0x43), P50, 1, , 2, P43, 1, P54, 1, If you can access the valuyes of P54 and LIDS before any lid events are triggered, then that will tell us if the values are correct in the hardware and perhaps an EC event was necessary to update LIDS and notify the OS. (and maybe Linux has a bug where that even was dropped and the EC handler was not invoked?) or if the values are incorrect in P54 and LIDS until there is an actual LID change, then this hardware and BIOS simply work that way and Linux will not be able to fix this bug. Fabian, It would be interesting if you can boot the laptop with the lid closed, log in over the network and observe the lid status then. presumably it will say closed, as that is apparently the inital value no matter what. Then on 1st open the lid state should immediately switch to open, because this ec event handler should run for the first time (and you should see an increment under acpi in /proc/interrupts) and update the value to be open. If that doesn't work, then I'm off track here and the issue is elsewhere. i really have the same doubt that whether LIDS/P54S is initialized the right value when the laptop boots. i suppose that adding an method (maybe the _INI) for LID0 device which will set LIDS to 1 may help this laptop boots correctly with the LID open. Any other places to set LIDS to 1 will also works. but i don't know whether this can be realized or not. Maybe i am on the wrong way from the beginning ... Rui, You can find the values of these locations at boot in two ways. 1. find the chip-set spec for the hardware, determine the addresses to read/write, and use inl(1) etc. or 2. modify the DSDT with move(variable, Debug) lines that are invoked at some boot time place before the event in question. build the DSDT into the kernel and build with CONFIG_ACPI_DEBUG so that the messages come out in the console log. 1. When I try the patch it still says "closed" after bootup. I attached dmesg. 2. When I try to boot the laptop with LID closed (by touching the sensor) it immediatly powers off again. When I reboot with LID closed it's the same. it powers off. When I wait until the grub menu comes I can close it and it will be boot. I logged in over network and lid state says "closed". Created attachment 8880 [details]
Dmesg output with patch
P.S.: I tried booting and logging in over network with the old kernel again _without_ the patch. > I logged in over network and lid state says "closed".
And when you opened it for the first time, did it correctly
switch to "open", and increment the acpi line in /proc/acpi/interrupts?
Yes, it switched to open. I don't have /proc/acpi/interrupt. >Yes, it switched to open. Everything goes well when boot with the Lid closed. This proves that Linux does not drop any events. It seems that the values remains 0 in LIDS no matter the Lid is open or closed until there is an actual LID change. This "0" value is meaningless because no one touches it since the system boots.But OS treats this as the signature of "closed" Lid state. This is rather a BIOS bug that Linux can't fix. >I don't have /proc/acpi/interrupts. cat /proc/interrupts check if there is an acpi interrupt increment when you open the Lid for the first time. No, it doesn't increment, it stays on 186 or something like this. I've to close the LID another time, then it begins to increment. So do you mean that when open the lid for the first time, State turns to "open" immediately but none acpi interrupt occurs. That's weird.:( How about this one: # /etc/init.s/acpid stop # cat /proc/acpi/event Would you please try this test and tell me the result? :) And if you can boot your laptop with Lid open and do the same two tests again, that will be great.:) I did the test again, and when I boot with lid closed it says closed and when I open it it says closed and I have to close and open it another time for correct value. sorry, I think I did something wrong before. Do you need the new tests too? OK. Sounds interesting. Let's repeat the tests again,and during the first step, i want you to give me the following information. Lid state, acpi interrupts(proc/interrupts). Boots with the lid open and lid closed, make a record every time you open/close your Lid until everything is OK.:) OK: === Boot with LID open === interrupts: 9: 149 XT-PIC acpi state: state: closed ==> LID CLOSE interrupts: 9: 156 XT-PIC acpi state: state: closed ==> LID OPEN interrupts: 9: 198 XT-PIC acpi state: state: open === Boot with LID close === interrupts: 9: 183 XT-PIC acpi state: state: closed ===> LID OPEN interrupts: 9: 218 XT-PIC acpi state: state: closed ===> LID CLOSE interrupts: 9: 225 XT-PIC acpi state: state: closed ===> LID OPEN interrupts: 9: 267 XT-PIC acpi state: state: open I hope this helps. Is the one interrupts-line OK? Is there a reason why interrupts increment now everytime? I'm on ac power so I don't think it's a "power interrupt" (if such things exist). What can that be? There is really an abnormal interrupt increment that brings me some difficulty to make sure whether there is an interrupt occurs when you open/close the Lid. This time let's try this way. Do the following soon after OS is started. # /etc/init.s/acpid stop # cat /proc/acpi/event open/close the lid for several times and record what is print out each time. And /proc/interrupts as well:) Created attachment 8914 [details]
new dsdt
override your dsdt with this one.
cat your Lid state before any Lid open/close operations.
then open/close it until everything is OK.
attach the dmesg output.:)
set CONFIG_ACPI_CUSTOM_DSDT=y and CONFIG_ACPI_CUSTOM_DSDT_FILE="/.../dsdt.hex" (the full pathname of the new dsdt file here). Make and install, and your new DSDT table will be used in place of the old one. I tried the new dsdt, this doesn't change anything. boot with lid open: interrupts:615 lid:closed ->close interrupts:661 lid:closed ->open interrups:672 lid:open boot with lid closed: interrupts:186 lid:closed ->open interrupts:223 lid:closed ->closed interrups:264 lid:closed ->open interrups:297 lid:open i remove acpid of the startup scripts for all this. I noticed that doing cat /proc/acpi/button/lid/LID0/state increases the interrupt line too. greetings PS: can't we just close this bug to won't fix or something? I'm spending far more time debugging that it annoys me. I think you should attatch the _dmesg_ output with the new dsdt. :) Debug information in the dmesg will tell us if the values are correct in the hardware. This can really help us find the key reason of this bug. Sorry to bother you too much. But we are getting closer to the right way step by step. It will be very kind of you to try it again. Thanks. Please reopen this bug if: - it is still present in kernel 2.6.19 and - you can provide the requested information. |