[ltp] belt & suspenders suspend-to-ram script for acpid

Richard Neill linux-thinkpad@linux-thinkpad.org
Thu, 22 Jun 2006 17:52:44 +0100


Eric Jorgensen wrote:
> On Thu, 22 Jun 2006 12:17:53 +0100
> Richard Neill <rn214@hermes.cam.ac.uk> wrote:
> 
> 
>>
>>Eric Jorgensen wrote:
>>
>>>   This is tailored to my X21, so there are a few specific items
>>>   that
>>>are specific to the X20/X21/T20 and similar machines. Users of
>>>better thinkpads will have to substitute the appropriate video bits.
>>>
>>
>>Thanks very much. I wonder whether this also applies to the very
>>similar  X22. My X22 sleeps fine, but goes totally dead  on resume:
>>the HDD spins  up, but that's it. This only occurs if I have 3D-accel
>>working.
>>
>>Can you tell me:
>>
>>   Which kernel and xorg versions you have
>>   Could you post your "Device" section of xorg.conf
> 
> 
> 
>    The X21 is just an X20 with a faster cpu - and has no 3d accel at
> all. You have a much newer ATi graphics chip. 

Thanks. Although I also have a Rage Mobility.  I can get about 600 fps 
out of glxgears if I load the dri module in xorg.conf, and *disable* 
mesa (software emulation of OpenGL).

> 
>    At any rate, 2.6.17.1 (also working in various other late 2.6
> kernels, back to 12 or so), and here ya go: 
> 
> Section "Device"
>         Identifier      "ATI Technologies, Inc. Rage Mobility P/M AGP
> 2x"        Driver          "ati"
>         BusID           "PCI:1:0:0"
> EndSection
> 
>  
> 
>>>there is logic to prevent going to sleep if the thinkpad has
>>>only just awakened in the last minute. This resolves the most
>>>annoying thing my thinkpad has ever done -- requiring me to wake it
>>>up three times
>>
>>I think it's a race condition caused by multiple scripts in 
>>/etc/acpi/events (and maybe some other clients of acpid) triggering on
>>
>>Fn-F4. They all try to sleep, one gets there first, and then the
>>others  take effect on wake up.
> 
> 
> 
>    Maybe for some people. Even if i have only one event script and one
> action script, it attempts to sleep three times. 
> 
>    My diagnostics show that on my X21, acpid is receiving three
> sequential lid events from the kernel. The events are numbered, and if
> i record the events, there are three distinct lid events and they
> absolutely come in threes.
> 
>    Additionally, the sleep script has always completely executed and
> exited before it gets called again - even if i put 'sleep 100' at the
> end. 
> 
>    I don't have the evidence anymore because my harddrive died. Never
> buy toshiba harddrives. Don't let the 16mb of cache tempt you. I had two
> of the things croak on me. 
> 
>    fwiw, I never use Fn-F4 or any other method to suspend - I just close
> the lid. 

Ah. Could it be that you have the BIOS configured to suspend on 
lid-close? The BIOS's internal suspend-logic is independent of ACPI!


Richard