[ltp] APMD and Standby on the TP-T21

Thomas Hood linux-thinkpad@www.bm-soft.com
Tue, 6 Mar 2001 21:59:39 +0000 (GMT)


--- "D. Sen" <dsen@research.att.com> wrote:
> Alright, so if I understand things right then this is the sequence of events
> for
> the following keystrokes:
> 
> 1) apm -x:
  a-pre1) apm talks to device drivers, telling them about the event
>     a) apm talks to apmd.
>     b) apmd calls the apmd_proxy script with two parameters
>        suspend/standby and user/system.
>     c) apmd_proxy runs the appropriate commands.
>     d) apmd then hands over to the APM BIOS which either
>        puts the machine on suspend or standby.
> 
> 2) Fn+Fx (or tpctl --x):
>     a) APM BIOS gets notified.
>     b) APM BIOS talks to apmd.
                           ^^^^ not quite
  b1) APM BIOS talks to apm
  b2) apm talks to device drivers, telling them about the event
  b3) apm talks to apmd, telling it about the event
>     c) apmd calls apmd_proxy with two parameters suspend/standby
>        and user/system.
>     d) apmd_proxy runs the appropriate commands.
>     e) apmd hands over ot the APM BIOS which either
>        puts the machine on suspend or standby.

Yes.

In some cases the order makes a difference.  For example,
it is a well known "feature" of the ThinkPad APM BIOS that
it will reject suspends if there is a network PCMCIA card
inserted and the system is on AC power.  If you have
apmd_proxy set up to do a "cardctl eject" before suspend
then an "apm --suspend" will be able to suspend while a
"tpctl --suspend" will not.

> *However*, in my machine 2c doesnt seem to be happening for the Fn+F3 (tpctl
> --standby) case. apmd_script is called but without the "standby user/system"
> parameters. So, I dont have control over what commands are called before
> standby for that sequence.

That sounds like a problem I had with the original apmd_proxy
script shipped with apmd 3.0final in Debian.  For some strange
reason the apmd maintainer wrote the apmd_proxy script so that
it would ignore system suspends while the machine was on AC
power.  I reported this as a bug and the maintainer replied
that he found this "feature" useful, but he agreed that it
should be disable-able and shouldn't be the default.  However
he hasn't uploaded a new version of the apmd package with
the change.  I was able to remove the "reject the suspend
if it's a system suspend and we're on AC power" bit of code
from apmd_proxy myself, quite easily.

> Thats the first problem. The second is that even if I did have control over
> the commands, (as in (1) with the apm -S command), I still see 'hda: lost
> interrupt" unless I use 'cardctl eject' before the machine is put on standby.

Probably what is going wrong is that a device driver is being
suspended before apmd_proxy is able to do the "cardctl eject",
resulting in the error message.  If it's a pcmcia device driver
that's causing the problem then the proper way to get a
"cardctl eject" is not to put this command in the apmd_proxy
script but to set APM=eject in /etc/pcmcia/apm.opts .

Thomas

____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

----- The Linux ThinkPad mailing list -----
The linux-thinkpad mailing list home page is at:
http://www.bm-soft.com/~bm/tp_mailing.html