[ltp] APM suspend with 2.6 kernel [long]

Thomas Hood linux-thinkpad@linux-thinkpad.org
Sat, 03 Jan 2004 12:49:47 +0100


On Sat, 2004-01-03 at 03:26, Charles Lepple wrote:
> The exact symptom (discussed in depth on LKML this past fall) is that the 
> suspend LED would start blinking after a suspend was requested (either via 
> the lid switch, the power/hibernate button, or the APM control program), but 
> would not fully suspend, and would return ~30 seconds later with the kernel 
> message "apm: suspend: Unable to enter requested state".

(Just to provide more background info ...)

This indicates that the suspend request was rejected by the APM
firmware, which would only happen because some piece of hardware
or other was not shut down properly in preparation for APM suspend.
Because of your work we now know that the (main) culprit is the i8042
keyboard-controller driver.


> [description of binary search]

Your earlier e-mail presented your results:

http://marc.theaimsgroup.com/?l=linux-kernel&m=105949030715144&w=2


> One of the first things I did was create the minimal kernel configuration
> [...]
> rmmod-ing the i8042 driver 
> on suspend, and modprobe-ing it on resume will make things work
> [...]

> For the kernel-hacking types, the good news is that the 2.6.1-rc1 patch 
> includes the framework to allow the i8042 module to react to power management 
> events.

Yes.  Here is the changelog entry:

    <dtor_core@ameritech.net>
	[PATCH]  Input: implement resume methods
	- Implement resume methods using serio_reconnect facility
	- Register i8042 with sysfs
	- Register i8042 with older PM scheme to restore keyboard
	  and mouse for APM users
	- Convert parameter handling to the new style
	- Unregister port not only when there is no free IRQ but
	  also if the port fails to activate.


>  This means that the module would stay loaded (or could be compiled in 
> directly), and would simply stop the keyboard polling timer when a suspend 
> event arrives. I would rather not volunteer to code this until I have access 
> to a faster machine for kernel compiles, though. And I'm not entirely sure 
> why the polling timer is needed (everything should be handled via interrupts, 
> as it was in 2.4), but I'll leave it to someone else to argue that on the 
> LKML.

Have you looked at all the suspend-related changes that were made in
-rc1?  The changelog for 2.6.1-rc1 contains this interesting stanzas,
for example:

   <arief_m_utama@telkomsel.co.id>
        [PATCH]  psmouse pm resume fix
        I just want to share a little change that I've did to
        psmouse_pm_callback() which without this, my synaptics
        touchpad would prevent my laptop (IBM Thinkpad T30)
        from suspending.

    <dtor_core@ameritech.net>
	[PATCH]  Input: add atkbd reconnect method
	Add reconnect method to atkbd to restore keyboard state after suspend (to
	be called from i8042 resume function)

    <dtor_core@ameritech.net>
	[PATCH]  Input: psmouse fixes
	- Remove psmouse_pm_callback since i8042 now has its own resume
	  handler which will issue reconnect request
	- Do not close/open serio port in psmouse_reconnect since i8042
	  should restore ports to the proper state before calling reconnect

    <dtor_core@ameritech.net>
	[PATCH]  Input: add serio_[un]register_port_delayed to fix deadlock
	Add serio_[un]register_port_delayed to allow delayed execution of
	register/unregister code (via kseriod) when it is not clear whether
	serio_sem has been taken or not.  Use in i8042.c to avoid deadlock


> Hope that clarifies a few things.

It does; thanks.
-- 
Thomas Hood <jdthood2@yahoo.co.uk>