Subject: Re: APM problems with 1.3_ALPHA snapshot
To: None <Havard.Eidnes@runit.sintef.no>
From: Chris G. Demetriou <cgd@pa.dec.com>
List: port-i386
Date: 11/18/1997 18:07:39
> I am having problems getting APM to work on my laptop (a Dell
> Latitude XPi/CD 150), and I would like to know:
> 
>  o Is the APM code considered to be stable and/or usable in
>    1.3_ALPHA?

Well, it works fine on my laptop, as long as I don't run apmd.
(My laptop, a ThinkPad 760EL, seems to want to deliver _lots_ of
certain types of APM events, e.g. suspend requests, rather than just
one, e.g. when the lid is closed.  This ends up confusing the
kernel+apmd, such that both try to suspend the system...)


>  o Is anyone else than me seeing the symptoms I do?
> 
> My problem is that I appear unable to get the suspend function to
> work as it should.  I have turned on full debugging in apm.c, and
> this is what happens:
> 
> During autoconf, I get the messages as shown below in the
> attachment.  After autoconf it continues on with printing
> messages "apmcall: func 11 from line 509 -> 0x1" about once per
> second.

Right that's "what events do you have waiting?" "none!"


> If I log in and do "zzz", I get "Suspending system..." and the
> following debug lines:
> 
> apmcall: func 11 from line 509 -> 0x1
> apmcall: func 10 from line 676 -> 0x0

This is the APM code (successfully) getting the power status.
(What version of the driver are you running, BTW?  those line numbers
... don't seem right.)


> apmcall: func 11 from line 509 -> 0x1
> apmcall: func 11 from line 509 -> 0x1
> apmcall: func  7 from line 604
> 
> and the cursor just sits behind the "604".  The bell "beeps" at
> the same time the last line is printed, but the screen is still
> on, and the power indicator on the PC is also on, but at this
> point the PC appears to be completely wedged, so I need to power
> cycle it to get its attention back.

That is theoretically where it's trying to suspend the system.


> If I press the "suspend" function key, the behaviour is a little
> different, I get:
> 
> apmcall func 11 from line 509 -> 0x1
> apmcall func 11 from line 509 -> 0x0
> apmev: user suspend request
> apmcall func  7 from line 604 -> 0x0
> apmcall func 11 from line 509 -> 0x1
> apmcall func  7 from line 604 -> 0x0
> apmcall func 11 from line 509 -> 0x1
> apmcall func  7 from line 604 -> 0x0
> apmcall func 11 from line 509 -> 0x1
> apmcall func  7 from line 604
> 
> and it freezes (as above) at this point.

Interesting that a number of set power state requests appear to have
succeeded.  What happens to the system while this is happening?


> About 6 months ago (?) I used to run NetBSD on this laptop with
> John Kohl's old PCMCIA patches and the then built-in APM support
> (I think it was integrated at that time), and I remember APM as
> working Just Fine on this machine with NetBSD.

The basic operation of the code hasn't changed significantly sense
then, only the way the APM driver is attached.


> apm: bioscall return: 102 504d 3 0 a92<OVFL,IEN,NF,AF> 0 0
> apm0 at mainbus0: bioscall return: 102 504d 3 0 a92<OVFL,IEN,NF,AF> 0 0
> apm0: bioscall return: 304 0 0 0 a97<OVFL,IEN,NF,AF,PF,CY> 0 0
> apm0: bioscall return: f000 f0fc f000 f000 206<IEN,PF> ffff ffff
> apm0: data segment fine: [f0000,fffff)
> apm0: code32len=ffff, datalen=ffff
> apm0: detail 30102 32b:f0000/0xf02b5000/ffff 16b:f0000/0xf02b5000 data f0000/0xf02b5000/ffff ep f0fc (30:0xf02c40fc) 0xf0200690
> apm0: apmcall: func 14 from line 645 -> 0x0
> Power Management spec V1.1

I can't see anything there that's obviously wrong.

I want to think about it and play around with a few things.  I'll get
back to you.




cgd