Most recent kernel where this bug did not occur: n/a Distribution: Mainline 2.6.16.13 + acpi-release-20060310-2.6.16 patches Hardware Environment: Thinkpad T43 2687 Software Environment: Debian Problem Description: Resuming from S3 (suspend-to-ram) using the power button causes a stray power-button event which shutdowns the machine. Apparently, ACPI 3.0 P62 says the kernel should be cleaning up the stray powerbutton event, instead of letting userspace deal with the mess. There is an analysis and patch about this issue at http://article.gmane.org/gmane.linux.acpi.devel/17555 I am just reporting the bug (which I verified), and the possible solution by Mr. Arnaud Patard in the above mentioned post. Steps to reproduce: boot with a kernel using acpi_sleep=s3_bios do echo mem > /sys/power/state (preferably using a properly setup hibernate script) wake machine up using the power button
Created attachment 8201 [details] patch from Arnaud Patard: delete powerbutton event after resume from S3 Patch and analysis by Arnaud Patard <apatard <at> mandriva.com>, posted to: http://article.gmane.org/gmane.linux.acpi.devel/17555
This is a downside in the patch. 'acpi_clear_event' isn't supposed to be called with interrupt disabled (it uses mutex).
Can't the code be modifed to use a semasphore of some sort, so that it supresses the powerbutton event after the mutex is released?
Reply to comment #2: Calling acpi_set_register() with ACPI_MTX_DO_NOT_LOCK instead of calling acpi_clear_event() would be better ?
Yes, I agree acpi_set_register() is the right way.
Created attachment 8223 [details] Incremental patch using acpi_set_register instead of acpi_clear_event This is an incremental version but I can send a full version if preferred :)
It's a bit nasty to use a global variable within ACPICA, acpi_gbl_fixed_event_info.
While the patch in comment #6 treats the symptom, the proper fix is to enable acpi_clear_event() to be called from interrupt context. To do that, the semaphore that acpi_set_register() uses needs to be replaced by a spin-lock. Fixing that is the subject of bug #6634
Ok. So, we'll have to wait having a fix for the bug #6634 ? Or one may change the acpi_clear_event prototype to get a second argument (ACPI_MTX_DO_NOT_LOCK or ACPI_MTX_LOCK) (I admit that this change of prototype is a ugly workaround :/ ) ?
ACPICA 20060608 replaced the mutex in acpi_set_register() with a spin-lock, so the original patch in comment #1 no longer needs to be modified.
shipped in 2.6.17-git9, closed.