Bug 17081
Summary: | Lid switch correct every other time; suspend every other lid close; Samsung N150-11 netbook | ||
---|---|---|---|
Product: | ACPI | Reporter: | Doug Currie (linuxkbt.9.eeeeeee) |
Component: | EC | Assignee: | Lan Tianyu (tianyu.lan) |
Status: | CLOSED DOCUMENTED | ||
Severity: | normal | CC: | aaron.lu, alan, andrzej, jrnieder, lenb, linuxkbt.9.eeeeeee, s.huels, tianyu.lan |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 3.4 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
The requested acpidump results
DSDT for Samsung NC10 Plus custom _LID method Lid states with _LID.aml custom method. Syslog tail after boot Syslog after loading _LID.aml Syslog 02 as described in lid states file Syslog 03 as described in lid states file Syslog 04 as described in lid states file Syslog 05 as described in lid states file Syslog 06 as described in lid states file custom _LID method syslog entries relating to comment #22 DSDT.hex |
Description
Doug Currie
2010-08-25 21:25:05 UTC
bug 5809 required a DSDT AML fix to make lid state work. That is bad news. Assuming Windows suspends on Lid close, it means that Windows is not checking _LID state to decide if it should suspend or not. (eg. perhaps Windows is just getting the lid event and assuming that since they are awake that they should suspend...) If Linux depends on a BIOS feature to work that Windows never tests, then Linux will always be less reliable -- for the system was tested and shipped with Windows... It may-be that in general, _LID is unreliable, and Linux user-space needs to stop depending on it... In the mean time, please supply the output from acpidump for this box and perhaps we can prove this theory. Created attachment 29862 [details]
The requested acpidump results
The requested acpidump results from Samsung N150 Plus.
Created attachment 42872 [details]
DSDT for Samsung NC10 Plus
Hi there,
same problem here with a Samsnung NC10 Plus which, I gather, is very similar to the N150 Plus. Disassembled DSDT of the machine is attached
Please let me know if I can help with anything else.
Regards,
Soenke
(In reply to comment #3) > Created an attachment (id=42872) [details] > DSDT for Samsung NC10 Plus > > Hi there, > > same problem here with a Samsnung NC10 Plus which, I gather, is very similar > to > the N150 Plus. Disassembled DSDT of the machine is attached > Please let me know if I can help with anything else. > > Regards, > > Soenke Sorry, I forgot: Running kernel is 2.6.32 from Debian testing (linux-image-2.6.32-5-amd64, Debian version 2.6.32-29), but the problem is also present in 2.6.37 from Debian experimental. Created attachment 51442 [details]
custom _LID method
Please
1. download the _LID.aml attached
2. cat _LID.aml > /sys/kernel/debug/acpi/custom_method
3. echo 1 > /sys/module/acpi/parameters/aml_debug_output
then close&open the lid for several times, get the lid state and attach the test result like:
action(close/open), lid-state-shown, dmesg-output
ping My bios is now reconfigured with the workaround suggested by DarrellKavanagh on Voria: http://www.voria.org/forum/viewtopic.php?f=3&t=523 > Disable "Wake on lid open" in the BIOS. the machine will then suspend every > time the lid is closed, but raising the lid no longer resumes, - use the > power switch to resume. I will change the bios back, enabling "Wake on lid open," and then use the custom method to get the data you need... in the next week when I will have access to the N150-11 again. Thank you. I'm at a loss... e@eSammy:~/Dropbox/eSammy$ cat _LID.aml > /sys/kernel/debug/acpi/custom_method bash: /sys/kernel/debug/acpi/custom_method: No such file or directory e@eSammy:~/Dropbox/eSammy$ cat _LID.aml _SB_.PCI0.LPC0.H_EC.LIDS[1p\/_SB_PCI0LPC0H_ECLIDS[1�\LIDSe@eSammy:~/Dropbox/eSammy$ e@eSammy:~/Dropbox/eSammy$ ls /sys/kernel/debug/ e@eSammy:~/Dropbox/eSammy$ mkdir /sys/kernel/debug/acpi/ mkdir: cannot create directory `/sys/kernel/debug/acpi/': No such file or directory e@eSammy:~/Dropbox/eSammy$ e@eSammy:~/Dropbox/eSammy$ sudo mount -t debugfs none /sys/kernel/debug e@eSammy:~/Dropbox/eSammy$ cat _LID.aml > /sys/kernel/debug/acpi/custom_method bash: /sys/kernel/debug/acpi/custom_method: No such file or directory e@eSammy:~/Dropbox/eSammy$ ls /sys/kernel/debug/ bdi dri ieee80211 kprobes mce sched_features tracing usb x86 e@eSammy:~/Dropbox/eSammy$ ^C oh, you need to run this is a newer kernel. say 2.6.36/37/38. Created attachment 53052 [details]
Lid states with _LID.aml custom method.
Lid states with _LID.aml custom method. Syslog files for the various tested states follow below.
Sorry I did not have time to test earlier. This is from a debian 2.6.38-2-amd64 kernel, custom method _LID.aml loaded as described here.
Created attachment 53062 [details]
Syslog tail after boot
Created attachment 53072 [details]
Syslog after loading _LID.aml
No difference to fresh boot
Created attachment 53082 [details]
Syslog 02 as described in lid states file
Created attachment 53092 [details]
Syslog 03 as described in lid states file
Created attachment 53102 [details]
Syslog 04 as described in lid states file
Created attachment 53112 [details]
Syslog 05 as described in lid states file
Created attachment 53122 [details]
Syslog 06 as described in lid states file
Created attachment 53622 [details]
custom _LID method
really nice bug report! :)
please try the _LID.aml attached and see if the the lid state is always reported correctly.
IMO, the binary file attached should workaround the problem for you, but indeed this should be an EC driver problem.
So it would be great if you can try to build a 2.6.38 kernel, uncomment line30 "/* #define DEBUG */" in drivers/acpi/ec.c, and redo the test.
Hi Zhang, thanks for the new custom method file. The work around seems to work fine here. Lid state is reported correctly, with and without suspend to ram. I am not sure whether or when I will find the time to test again with a rebuilt kernel, sorry about that. Regards, Soenke okay. Reject this bug for now, please feel free to re-open it if you can do the test in comment #19. I have a Samsung N150 Plus that exhibits this bug. I have done the test in comment #19 with a recent mainline kernel: $ cat /proc/version Linux version 3.4.0-rc6-custom (root@andrzej-N150P) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #2 SMP Sat May 12 16:46:41 BST 2012 It seems that the bug manifests only if the laptop suspends to RAM when the lid is closed. With the custom method, the lid state is reported correctly and the laptop can suspend/resume correctly every time the lid is closed/opened. I attach files containing the output in /var/log/syslog upon doing an open/close action. Please let me know if there is anything else that is required. Without custom method. Not configured to suspend on lid close. --------------------------------------------------------------- | action(close/open) | lid-state-shown | /var/log/syslog output | |--------------------+-----------------+------------------------| | initial state | open | - | | close | closed | syslog.1 | | open | open | syslog.2 | | close | closed | syslog.3 | | open | open | syslog.4 | |--------------------+-----------------+------------------------| Without custom method. Suspend on lid close. --------------------------------------------- (suspend happens every other time) | action(close/open) | lid-state-shown | /var/log/syslog output | |--------------------+-----------------+------------------------| | initial state | open | - | | close | - | - | | open | closed | syslog.5 | | close | closed | syslog.6 | | open | open | syslog.7 | | close | - | - | | open | closed | syslog.8 | |--------------------+-----------------+------------------------| With custom method. Not configured to suspend on lid close. ------------------------------------------------------------- | action(close/open) | lid-state-shown | /var/log/syslog output | |--------------------+-----------------+------------------------| | initial state | open | - | | close | closed | syslog.9 | | open | open | syslog.10 | | close | closed | syslog.11 | | open | open | syslog.12 | |--------------------+-----------------+------------------------| With custom method. Suspend on lid close. ------------------------------------------ (suspends every time lid closed) | action(close/open) | lid-state-shown | /var/log/syslog output | |--------------------+-----------------+------------------------| | initial state | open | - | | close | - | - | | open | open | syslog.13 | | close | - | - | | open | open | syslog.14 | | close | - | - | | open | open | syslog.15 | |--------------------+-----------------+------------------------| Created attachment 73275 [details] syslog entries relating to comment #22 Reopening (Andrzej, watch closely if you want to see how to do this for next time). (Reassigning to Zhang Rui who was working on this before. Sorry for the noise.) Hi All: Found the root cause. There is two EC Query methods _Q5E and _Q5F which are associated with lid open and close event. They will read lid's state from the \_SB.PCI0.LPC0.H_EC.LIDS and then store the value to the \LIDS. When _LID method is invoked, it return the value stored in the \LIDS. For no suspend on lid close case, this can work. Because both _Q5E and _Q5F will be called when lid open and close. But in the suspend on lid close case, the close event will be processed during system running and suspend machine. So the value of \LIDS is close at this point. But when open lid, bios will detect the open event and resume system. For the open lid event, system don't get it and _Q5F will not be invoked. So \LIDS value is still close. So this is DSDT table problem. If _LID method read status directly from EC, there would be no problem(Rui's custom method already prove this.) So the problem can't be fixed by code in linux. Only solution is to override DSDT talbe. I will attach a table that should fix your problem. But you need compile the kernel by youself. Device (H_EC) { ... Method (_Q5E, 0, NotSerialized) { Store (LIDS, \LIDS) Notify (\_SB.LID0, 0x80) } Method (_Q5F, 0, NotSerialized) { Store (LIDS, \LIDS) Notify (\_SB.LID0, 0x80) } ... } Device (LID0) { Name (_HID, EisaId ("PNP0C0D")) Method (_LID, 0, NotSerialized) { Return (LIDS) } } Created attachment 98321 [details] DSDT.hex Please follow the link to override the DSDT. I have attached the DSDT table and you just need do step 5-7. https://lesswatts.org/projects/acpi/overridingDSDT.php |