# ACPI questions

## Dizzutch

Hey all, sorry for this kind of lengthy post, but I'd like to get ACPI working correctly.

I switched from APM to ACPI and am now trying to set it up. I figured out that in order to put my system to sleep when the lid closes (which is my primary concern at the moment) that i have to run this command

```

echo 3 > /proc/acpi/sleep

```

echoing 1 doesn't put the system to sleep, it just blanks the screen, and then comes back up. Sometimes, when i close the lid, and open it back up when i want to use my ThinkPad again, i get a kernel dump on my desktop. I can get to a tty by hitting Ctrl+Alt+F1. and i mananged to get the output, which i'll post here.

```

...

PM: Preparing system for suspend

vesafb: mode switch failed (eax: 0x14f)

Stopping tasks: ==================================================================|

eth1: Going into suspend...

ehci_hcd 0000:00:1d.7: suspend D0 --> D3

uhci_hcd 0000:00:1d.2: suspend_hc

uhci_hcd 0000:00:1d.1: suspend_hc

uhci_hcd 0000:00:1d.0: suspend_hc

PM: Entering state.

Back to C!

Warning: CPU frequency is 1500000, cpufreq assumed 600000 kHz.

PM: Finishing up.

PCI: Setting latency timer of device 0000:00:1d.0 to 64

PCI: Setting latency timer of device 0000:00:1d.0 to 64

PCI: Setting latency timer of device 0000:00:1d.1 to 64

PCI: Setting latency timer of device 0000:00:1d.1 to 64

PCI: Setting latency timer of device 0000:00:1d.2 to 64

PCI: Setting latency timer of device 0000:00:1d.2 to 64

ehci_hcd 0000:00:1d.7: resume from state D3

PCI: Setting latency timer of device 0000:00:1d.7 to 64

ACPI: PCI interrupt 0000:00:1f.1[A] -> GSI 11 (level, low) -> IRQ 11

ACPI: PCI interrupt 0000:00:1f.5[B] -> GSI 11 (level, low) -> IRQ 11

PCI: Setting latency timer of device 0000:00:1f.5 to 64

uhci_hcd 0000:00:1d.2: wakeup_hc

uhci_hcd 0000:00:1d.0: wakeup_hc

uhci_hcd 0000:00:1d.1: wakeup_hc

ACPI: PCI interrupt 0000:01:00.0[A] -> GSI 11 (level, low) -> IRQ 11

PCI: Enabling device 0000:02:01.0 (0000 -> 0003)

ACPI: PCI interrupt 0000:02:01.0[A] -> GSI 11 (level, low) -> IRQ 11

eth1: Coming out of suspend...

Restarting tasks... done

uhci_hcd 0000:00:1d.2: suspend_hc

uhci_hcd 0000:00:1d.0: suspend_hc

uhci_hcd 0000:00:1d.1: suspend_hc

MCE: The hardware reports a non fatal, correctable incident occurred on CPU 0.

Bank 1: f200000000000175

mtrr: 0xe0000000,0x2000000 overlaps existing 0xe0000000,0x1000000

mtrr: 0xe0000000,0x2000000 overlaps existing 0xe0000000,0x1000000

[drm:radeon_cp_init] *ERROR* radeon_cp_init called without lock held

[drm:radeon_unlock] *ERROR* Process 14472 using kernel context 0

atkbd.c: Keyboard on isa0060/serio0 reports too many keys pressed.

PM: Preparing system for suspend

Unable to handle kernel paging request at virtual address 00010000

 printing eip:

c02f5798

*pde = 00000000

Oops: 0002 [#1]

Modules linked in: radeon snd_pcm_oss snd_mixer_oss snd_seq_oss snd_seq_midi_event snd_seq snd_intel8x0 snd_ac97_codec snd_pcm snd_timer snd_page_alloc gameport snd_mpu401_uart snd_rawmidi snd_seq_device snd dm_mod button ac battery thermal fan processor ibm_acpi uhci_hcd ohci_hcd ehci_hcd ipaq usbserial usb_storage usbnet usbcore ip_tables ipw2200 ieee80211 ieee80211_crypt e1000

CPU:    0

EIP:    0060:[<c02f5798>]    Not tainted VLI

EFLAGS: 00010292   (2.6.9-gentoo-r13)

EIP is at vesafb_do_vm86+0x38/0x3d0

eax: c05687c0   ebx: 00000000   ecx: 00000000   edx: c05687c0

esi: c7147808   edi: c0568820   ebp: c7147800   esp: c1625ed4

ds: 007b   es: 007b   ss: 0068

Process vesafb (pid: 632, threadinfo=c1624000 task=dfdde560)

Stack: c05687c0 c7147808 00000054 dfd2e020 c7147864 c1625f60 c1625f54 c02f5deb

       c7147808 7e27a2c0 000f5d30 c04c2da0 c1624000 c1625f60 c1625f54 c1625f6c

       c02f6035 00004000 fffffff6 00000001 00060000 00000007 01700000 c1624000

Call Trace:

 [<c02f5deb>] vesafb_handle_tasks+0x2bb/0x380

 [<c02f6035>] vesafb_thread+0x185/0x2e0

 [<c0118b80>] autoremove_wake_function+0x0/0x60

 [<c01172c7>] deactivate_task+0x27/0x40

 [<c0118b80>] autoremove_wake_function+0x0/0x60

 [<c011c5bf>] exit_notify+0x38f/0x860

 [<c01176c7>] schedule_tail+0x17/0x50

 [<c0105f72>] ret_from_fork+0x6/0x14

 [<c02f5eb0>] vesafb_thread+0x0/0x2e0

 [<c02f5eb0>] vesafb_thread+0x0/0x2e0

 [<c01042ad>] kernel_thread_helper+0x5/0x18

Code: 83 ec 10 31 db 8b 74 24 20 89 d8 f3 ab 89 74 24 04 b8 54 00 00 00 bf 20 88 56 c0 89 44 24 08 c7 04 24 c0 87 56 c0 e8 78 2b fc ff <c6> 05 00 00 01 00 cd b9 08 00 00 00 89 d8 c6 05 01 00 01 00 ff

```

I'm not sure where to go from here, I'll post my /etc/acpid/default.sh here

```

#!/bin/sh

# Default acpi script that takes an entry for all actions

set $*

group=${1/\/*/}

action=${1/*\//}

case "$group" in

  button)

    case "$action" in

      power)  /sbin/init 0

        ;;

      lid) echo 3 > /proc/acpi/sleep

        ;;

      *)  logger "ACPI action $action is not defined"

        ;;

    esac

    ;;

  *)

    logger "ACPI group $group / action $action is not defined"

    ;;

esac

```

and my /etc/acpi/events/default here

```

event=.*

action=/etc/acpi/default.sh %e

```

Once again, sorry for this lenghty post, but any ideas, tips or hints would be highly appreciated. oh, here's a snip from my lsmod

```

button                  6544  0 

ac                      4740  0 

battery                 9860  3 

thermal                15752  3 

fan                     4100  0 

processor              21544  1 thermal

ibm_acpi               18420  0

```

Thank you

-JSS

----------

## schmobag

I'm still using apm on my thinkpad, but I'm interested to see how your problem works out, as I've been thinking for a while about switching to acpi.

On a slightly related note, I just switched from ndiswrapper to the native ipw2200 driver, but now my wireless network connection can't survive a sleep/wake-up cycle.  Is that normal?  Anybody know of a fix?

----------

## Dizzutch

I spent last weekend studying ACPI and I got software suspend working for the most part. I'm still tweaking things left and right, but with acpi and speedfreqd i got my system working the power management pretty well. I say, ust give it a whirl and let me know if you have any specific issues.

----------

## quat

 *schmobag wrote:*   

> On a slightly related note, I just switched from ndiswrapper to the native ipw2200 driver, but now my wireless network connection can't survive a sleep/wake-up cycle.  Is that normal?  Anybody know of a fix?

 in case you haven't tried: try reloading the module. of course unload it first (not only ipw2200 but all connected with ipw2200 driver)

it works 4 me with compaq notebook

----------

## schmobag

I know that I can manually reload the module.  That has worked since I switched.  What I want is to be able to do is just wake up my computer, and have the network working.  That's how it was with ndiswrapper; no manual reloading required.  I would have stayed with ndiswrapper, but newer versions (newer than 0.7 or 0.8, something like that) kept causing kernel panics, so I figured it was time to jump over to the native driver.

----------

## Dizzutch

I've been using the hibernate-script and that was one of the problems, I suggest checking the ipw2200 bug database, and if there's nothing there submit a bug.

----------

