# ACPI CPU Usage problems ( events process taking near 100% )

## MRussell

I have searched and searched these forums and google and have not yet found a working solution.

Here is my case.  I have a Toshiba Satellite Pro 6000 laptop.  I just freshly loaded Gentoo on the machine.  It has previously been loaded and run with Libranet without any problems.  I am currently using the new 2.6 kernel.

Whenever ACPI support is enabled I end up with a process 'events/0' that takes near 100% of the cpu, as well as the cpu fan going crazy (ie comes on full speed and doesn't stop till I turn the notebook off).  I have disabled all ACPI options except the basic support and that makes no difference.  I have disabled APIC support (don't know that it makes a diff).  I have also disabled cpu frequency scaling just to make sure. If I completely remove ACPI support from the kernel then the problem goes away.  So I know the problem revolves around ACPI but I can't figure out how to fix it.

I have also tried using the mm sources which includes the latest version of the ACPI stuff, to no avail.  I also ran across a thread that indicated I should try to comment out some code in the evrgnini.c file, but that also didn't do anything.

Anyone else having a similiar problem and fixed it?

I'd remove ACPI support but when I do then I can't get the nic to work. catch-22 huh   :Rolling Eyes: 

Mark Russell

----------

## Suicidal

Do you have the most recent bios for your computer? sometimes thier acpi is broken.

----------

## dc2rpt

Hi Mark and all others here :)

 *MRussell wrote:*   

> 
> 
> Whenever ACPI support is enabled I end up with a process 'events/0' that takes near 100% of the cpu, as well as the cpu fan going crazy (ie comes on full speed and doesn't stop till I turn the notebook off). 

 

The only hint, what i could give is:

I had similar problemes with gentoo-sources 2.4.20, with vanilla 2.4.22/2.4.23 acpi run fine. 

But with 2.6.0 i had no problems with acpi. 

cu Thomas

----------

## JPMRaptor

You need to make a small change to the kernel source and rebuild your kernel.  

In /usr/src/linux/drivers/acpi/events/evrgnini.c around line 27 there's a line that reads:

acpi_os_derive_pci_id (node, region_obj->region.node, &pci_id);

Comment out that line (wrap it in /* ...  */ ) and recompile.

I've been running with this change for several months and everything works just fine.

----------

## MRussell

I tried upgrading the BIOS this morning and that didn't fix anything.  Also I have already tried the trick with commenting out that code.  Note that I didn't find that exact line but I did find something very close ( one of the parameter names was differert).

Still no luck with either attempt.  I'm starting to wonder if maybe my laptop requries a custom dsdt for it.  Unfortunently I have not been able to find one if it does exist.  Latter today I will probably make a post to the acpi mailing lists and see if anyone out there might be more familiar with the problem.

I'll be watching this thread and if I find out anything I will post here.

Mark Russell

----------

## JPMRaptor

Oops, just noticed a typo in my last message.  It's around line 270 not 27 (see patch below).

The commenting out of the line should work for you.  I've used it for the last 3 or 4 kernel versions.  I'm running 2.4.20-gentoo-r9 now, but have been using it for a while.  

Here's the diff output for the change

```
--- evrgnini.c  2003-12-13 18:15:24.000000000 -0500

+++ evrgnini.c.bak      2003-12-13 18:14:38.000000000 -0500

@@ -272,7 +272,7 @@

        /*

         * Complete this device's Pci_id

         */

-       /* acpi_os_derive_pci_id (node, region_obj->region.node, &pci_id); */

+       acpi_os_derive_pci_id (node, region_obj->region.node, &pci_id);

        *region_context = pci_id;

        return_ACPI_STATUS (AE_OK);

```

----------

## MRussell

The closest thing to that code in the 2.6 kernel is this

```

   /* Complete this device's pci_id */

   acpi_os_derive_pci_id (pci_root_node, region_obj->region.node, &pci_id);

```

This is found at line 308.  I have tried commenting this out but it doesn't make a difference.

Mark Russell

----------

## MRussell

while I hate to do this...

*bump*

Still looking for a solution that doesn't involve downgrading the kernel (mostly cause I like the new kernel and how it make KDE feel  :Wink: 

MAR

----------

## jana

My guess is that it's not a kernel problem, it's a problem with your acpi scripts.  (If you've got a fully populated /proc/acpi directory, then your kernel is doing what it should!)  

What do you have in /etc/acpi?  Keep in mind that if you borrow a script from someone else you'll almost certainly have to tailor it to your particular /proc/acpi directory tree.

I had the same problem the first time I tried to blindly run the (fantastic) scripts in this forum.  I had to customize the directories (including the ones that are in bash syntax).  Here's an important one:  make sure that the shell files are chmoded to be executable.  Similarly, make sure that any files referenced by files in the events dir actually exist!

What do your logs look like?

tail /var/log/acpid

tail /var/log/everything/current

 - j

----------

## MRussell

I'm currently using the script that comes with acpid which doesn't really do anything.  The log shows

[Fri Jan  9 20:53:17 2004] received event "battery BAT1 00000080 00000001"

[Fri Jan  9 20:53:17 2004] executing action "/etc/acpi/default.sh battery BAT1 0

0000080 00000001"

[Fri Jan  9 20:53:17 2004] BEGIN HANDLER MESSAGES

[Fri Jan  9 20:53:17 2004] END HANDLER MESSAGES

[Fri Jan  9 20:53:17 2004] action exited with status 0

[Fri Jan  9 20:53:17 2004] completed event "battery BAT1 00000080 00000001"

This set of messages shows up every 20-30 seconds.  So I don't think its the scripts causing the problem.  It looks more like something with the ACPI configuration (ie dsdt)

MAR

----------

