# APM & ACPI IBM Thinkpad R40

## tachikoma

I'm having trouble getting my thinkpad r40 to shutdown.

Besides that, I'm pretty much happy with everything

I've heard that ACPI doesn't work with Thinkpad R40 (i'm prob wrong)

Hence, chose APM in kernel

using kernel 2.4.20-gentoo-r6, my .config is like this:

CONFIG_PM=y

CONFIG_APM=y

# CONFIG_APM_IGNORE_USER_SUSPEND is not set

CONFIG_APM_DO_ENABLE=y

# CONFIG_APM_CPU_IDLE is not set

# CONFIG_APM_DISPLAY_BLANK is not set

# CONFIG_APM_RTC_IS_GMT is not set

# CONFIG_APM_ALLOW_INTS is not set

CONFIG_APM_REAL_MODE_POWER_OFF=y

#

# ACPI Support

#

# CONFIG_ACPI is not set

I've also got apmd running at boot

Has anybody gotten around gettin thinkpad r40 to shutdown properly?

----------

## snowbum

I do not have a thinkpad, but I know they have good hardware. You may want to try the 2.6.4 kernel. AFAIK, ACPI support is better. Shutdown works for me, just don't enable *APIC* support. Don't know how the suspend or standby will work for you though. Be warned that switching to a 2.6 kernel will take some configing if you want to use udev instead of dvefs.

----------

## jcmorris

You should have the following:

CONFIG_PM=y

CONFIG_APM=y

# CONFIG_APM_IGNORE_USER_SUSPEND is not set

CONFIG_APM_DO_ENABLE=y

CONFIG_APM_CPU_IDLE=y #this works fine on my machine

CONFIG_APM_DISPLAY_BLANK=y #no harm in this

# CONFIG_APM_RTC_IS_GMT is not set

CONFIG_APM_ALLOW_INTS=y  #read the help, do this for Thinkpads

CONFIG_APM_REAL_MODE_POWER_OFF=y 

I think CONFIG_APM_ALLOW_INTS may help you with your problem.  The above are the things I've got set on my 2.6.5-rc2 system.  Good luck!

jcm

----------

## jcmorris

Also, another note, for reliable suspend/resume in X, you MUST use the latest  DRI CVS snapshot

http://dri.sourceforge.net/cgi-bin/moin.cgi/Building

jcm

----------

## tachikoma

thank you so much!

I'll try right away   :Very Happy: 

----------

## tachikoma

I've tried the following setting, but still won't shut down  :Crying or Very sad: 

```
CONFIG_PM=y

CONFIG_APM=y

# CONFIG_APM_IGNORE_USER_SUSPEND is not set

CONFIG_APM_DO_ENABLE=y

CONFIG_APM_CPU_IDLE=y

CONFIG_APM_DISPLAY_BLANK=y

# CONFIG_APM_RTC_IS_GMT is not set

CONFIG_APM_ALLOW_INTS=y

CONFIG_APM_REAL_MODE_POWER_OFF=y

#

# ACPI Support

#

# CONFIG_ACPI is not set
```

maybe I should just give up...

or should I try out every possible setting   :Twisted Evil: 

----------

## jcmorris

Okay, you have an interesting case  :Smile:   Hmmm, do you think there could be some sort of bug in the init scripts?  Try first stopping everything, unmount all filesystems, and run:

init S

mount -n -o remount,ro /

sync

shudown -h now

Let me know how it goes.

jcm

----------

## seltrus

I have the R40 as well.  Be sure to update your BIOS, especially before trying anything ACPI related.

2.4.20 settings that I know had shutdown working:

```

CONFIG_PM=y

CONFIG_APM=y

# CONFIG_APM_IGNORE_USER_SUSPEND is not set

CONFIG_APM_DO_ENABLE=y

# CONFIG_APM_CPU_IDLE is not set

CONFIG_APM_DISPLAY_BLANK=y

# CONFIG_APM_RTC_IS_GMT is not set

CONFIG_APM_ALLOW_INTS=y

# CONFIG_APM_REAL_MODE_POWER_OFF is not set

```

2.6.x settings that work too:

```

# Power management options (ACPI, APM)

CONFIG_PM=y

# CONFIG_PM_DISK is not set

# APM (Advanced Power Management) BIOS Support

CONFIG_APM=y

# CONFIG_APM_IGNORE_USER_SUSPEND is not set

CONFIG_APM_DO_ENABLE=y

CONFIG_APM_CPU_IDLE=y

CONFIG_APM_DISPLAY_BLANK=y

# CONFIG_APM_RTC_IS_GMT is not set

CONFIG_APM_ALLOW_INTS=y

# CONFIG_APM_REAL_MODE_POWER_OFF is not set

# IPMI

# CONFIG_IPMI_HANDLER is not set

```

Suspend works for me on 2.6.3 with the above config, but after about 30 mins or so, the system freezes, so I don't use suspend anymore.

----------

## jcmorris

You were using 2.6.3 and having suspend issues?  Me too!  2.6.3 was plagued with problems for me, I recommend a 2.6.5-rc.

jcm

----------

## Earthwings

Also make sure CONFIG_SMP is disabled.

----------

## jcmorris

 *Earthwings wrote:*   

> Also make sure CONFIG_SMP is disabled.

 

Along the same lines, make sure APIC (I don't mean ACPI) uni-processor support is disabled.

jcm

----------

## snowbum

jcmorris, do you have suspend working with 2.6.5rc? Did you get it to work with 2.6.4?

I have 2.6.4mm and no suspend/standby. Well, it goes down, but never come back up all the way - just the power light changes status and the disk spins. It'd be real sweet to get suspend working. Anyone got ACPI suspending *and* resuming well?

----------

## jcmorris

Hmmm, and this is with APM?  In console or X?  Any beeps?

jcm

----------

## snowbum

It's without APM. I think I have just ACPI enabled. This is from X. I guess I could try the console. No beeps, though it never did even on boot or in the console - no pc beep. The LCD backlight doesn't even come back on though. So I think it runs deeper than X. One clue is that my "Centrino" wificard LED doesn't come back on. I'm pretty sure other devices aren't back up either. Everything seems to go into suspend fine. Power LED indicated it's suspended. But it won't come back on. Shall I post some kernel config info?

----------

## jcmorris

With ACPI, there is no way to wake it back up  :Smile:   I currently subscribe to the linux-thinkpad mailing list (www.linux-thinkpad.org).  I found a very hard-to-find 2.6 ACPI patch on the 'net that allows you to set certain  events/buttons to wake the system (you have to set them manualy each boot, though).  For some reason, ACPI on thinkpads likes to disable all inputs  :Smile:   Is there an efficient way in which I can send it to you?

jcm

----------

## snowbum

Yes, and thank you! You can send it here: mcweels(AT)yahoo.com. I don't think it is too big to fit in there. I understand the problem better now. With this information, I think I am better equipt to tackle this issue. I'll keep everyone updated.

Again many thanks.

----------

## seltrus

whoa, you got ACPI resume working?  with X and video and everything?  i never got ACPI to even think about coming out of S3 sleep.  perhaps you could post a link to said patch so others can find it.  is there a website for it with some general info too?

thanks

----------

## snowbum

OK, I want to update everyone on my findings.

My notebook comes out of a "suspend to disk" with a corrupt fb - system unusable. I have yet to try it with my current 2.6.4 config and no fb. With a 2.6.3 and no fb, it seems to resume, but not fully - the system is unusable.

When I put it into a suspend:

```
echo 3 > /proc/acpi/sleep
```

It goes down. The power light indicates it is suspended. When I press a key on the keyboard the power light ceases to blink and turns off as if it was off. However it is not because it will not turn on without a hardware reset.

So it seems it could be the the software is not reacting to the event.

I have yet to try the above mentioned patch courtesy of jcmorris.

For all you IBM users, this person seems to have gotten it to work:

http://www.enyo.de/fw/hardware/thinkpad/

----------

## tachikoma

After numerous tries, I'm still unsucessful in getting

thinkpad to shutdown properly.

I guess it'll be a good idea to try ACPI instead.

For those who has ACPI working, are you experiencing

better battery life compared to using APM?

Using APM my battery dies in a matter of 1 hour,

while my in Windows it lasts for 2~ hours

----------

## snowbum

Uhhh well, ACPI does support CPU throtoling and a host of other power saving features. I guess it's just if your BIOS/machine does them. I think all ACPI features work for me except, as we continue to discuss here, suspend.

If your notebook is quite new, say < 2002, you probably don't even have an APM BIOS. Therefore, APM support in the kernel is effectivly doing nothing - other than the shutdown, and maybe screen blanking, etc...

----------

