Bug 9263 - APCI interrupts, but acpi_listen show nothing (Thinkpad X40)
Summary: APCI interrupts, but acpi_listen show nothing (Thinkpad X40)
Status: REJECTED WILL_NOT_FIX
Alias: None
Product: ACPI
Classification: Unclassified
Component: Config-Interrupts (show other bugs)
Hardware: All Linux
: P1 low
Assignee: Zhang Rui
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-30 09:32 UTC by Benjamin Pineau
Modified: 2007-12-06 17:29 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.24-rc1
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
Binary ACPI dump (19.54 KB, application/x-gzip)
2007-10-30 09:33 UTC, Benjamin Pineau
Details
Kernel config (plain 2.6.24-rc1) (17.11 KB, application/x-gzip)
2007-10-30 09:34 UTC, Benjamin Pineau
Details
dmesg (from a 2.6.24-rc1) (23.79 KB, text/plain)
2007-10-30 09:34 UTC, Benjamin Pineau
Details
lsmod (2.6.24-rc1) (2.53 KB, text/plain)
2007-10-30 09:35 UTC, Benjamin Pineau
Details
lspci -vvxx (running 2.6.24) (14.58 KB, text/plain)
2007-10-30 09:35 UTC, Benjamin Pineau
Details
content of /proc/acpi/wakeup (331 bytes, application/octet-stream)
2007-10-30 09:36 UTC, Benjamin Pineau
Details
content of /proc/interrupts (968 bytes, application/octet-stream)
2007-10-30 09:36 UTC, Benjamin Pineau
Details
dmesg with CONFIG_ACPI_DEBUG and Zhang Rui's debug mask (28.95 KB, application/octet-stream)
2007-10-31 04:00 UTC, Benjamin Pineau
Details
patch vs 2.6.21 to show acpi interrupt stats (10.59 KB, patch)
2007-11-02 10:20 UTC, Len Brown
Details | Diff
dmesg with new suggested mask (103.34 KB, text/plain)
2007-11-07 05:07 UTC, Benjamin Pineau
Details
/sys/firmware/acpi/interrupts/stats before (570 bytes, application/octet-stream)
2007-11-07 05:08 UTC, Benjamin Pineau
Details
/sys/firmware/acpi/interrupts/stats after some time and a few more interrupts (570 bytes, application/octet-stream)
2007-11-07 05:08 UTC, Benjamin Pineau
Details
Plain text acpidump (277.81 KB, application/octet-stream)
2007-11-19 08:56 UTC, Benjamin Pineau
Details
Same, but binary (acpidump -b) (59.95 KB, application/octet-stream)
2007-11-19 08:57 UTC, Benjamin Pineau
Details

Description Benjamin Pineau 2007-10-30 09:32:26 UTC
Most recent kernel where this bug did not occur:
Distribution: Ubuntu Gutsy 7.10
Hardware Environment: IBM Thinkpad X40, ICH4, BIOS 2.08 
Software Environment: Linux 2.6.24-rc1, acpid/acpi_listen 1.0.4
Problem Description:

On my laptop (IBM Thinkpad X40 model 2371Y29, BIOS release 
1UETD3WW 2.08), running an unpatched stock 2.6.24-rc1 kernel, 
powertop often shows a few (but relatively persistent) 
wake ups per second caused by ACPI, but acpi_listen doesn't 
see any event.

It looks like this, in powertop:
17,0% (  5,7)       <interrupt> : acpi

The number of interrupts per second can vary (usually between
1 to 8 per sec.), and sometimes powertop show no acpi interrupts
at all during several seconds.

acpi_listen(8) seems to be otherwise working well 
(ie. it catches all AC power plugs/unplugs).

This happens also with kernels 2.6.23 and 2.6.22.

I'm willing to test, please just ask what you want 
me to do. I can also provide a remote root shell on 
the laptop if we can exchange a password securely.

I'll attach outputs of the following commands: 
"acpidump -b|gzip", "dmesg", "lsmod"
"lspci -vvxx", "cat /proc/acpi/wakeup", 
"cat /proc/interrupts", "cp /proc/config.gz"

Steps to reproduce:
Comment 1 Benjamin Pineau 2007-10-30 09:33:31 UTC
Created attachment 13338 [details]
Binary ACPI dump
Comment 2 Benjamin Pineau 2007-10-30 09:34:15 UTC
Created attachment 13339 [details]
Kernel config (plain 2.6.24-rc1)
Comment 3 Benjamin Pineau 2007-10-30 09:34:43 UTC
Created attachment 13340 [details]
dmesg (from a 2.6.24-rc1)
Comment 4 Benjamin Pineau 2007-10-30 09:35:08 UTC
Created attachment 13341 [details]
lsmod (2.6.24-rc1)
Comment 5 Benjamin Pineau 2007-10-30 09:35:32 UTC
Created attachment 13342 [details]
lspci -vvxx (running 2.6.24)
Comment 6 Benjamin Pineau 2007-10-30 09:36:13 UTC
Created attachment 13343 [details]
content of /proc/acpi/wakeup
Comment 7 Benjamin Pineau 2007-10-30 09:36:36 UTC
Created attachment 13344 [details]
content of /proc/interrupts
Comment 8 Zhang Rui 2007-10-30 22:44:05 UTC
please set CONFIG_ACPI_DEBUG and rebuild your kernel,
and then,
echo 0xffff0004 > /sys/module/acpi/parameters/debug_layer
echo 0x8000001f > /sys/module/acpi/parameters/debug_level
and attach the dmesg output after receiving some acpi interrupts.
Comment 9 Benjamin Pineau 2007-10-31 04:00:21 UTC
Created attachment 13359 [details]
dmesg with CONFIG_ACPI_DEBUG and Zhang Rui's debug mask

Here it is.
I collected about one minute of acpi debug in dmesg
while powertop was seeing about 0.7 to 1.1 acpi interrupts
per second (not a lot at this time), and acpi_listen, 
started in an other shell, didn't display any event.
Comment 10 Len Brown 2007-11-02 10:20:16 UTC
Created attachment 13380 [details]
patch vs 2.6.21 to show acpi interrupt stats

please watch /sys/firmware/acpi/interrupts/stats
before and after the acpi events to see what is
causing the interrupts.

note, this is a 2.6.21 patch, i'll be forward porting it shortly,
but if you've got a 2.6.21 kernel handy, you can use it as-is.
Comment 11 Len Brown 2007-11-02 10:23:20 UTC
BTW. the output in comment #9 shows a bunch of battery activity.
do the interrupt bursts go away if you rmmod the battery driver?
is there something in the GUI that is polling the battery state?
Comment 12 Zhang Rui 2007-11-05 19:12:01 UTC
Re comment #9:
Hi, Benjamin,
Sorry that the debug mask I told you didn't make sense,
please try
echo 0x04 > /sys/module/acpi/parameters/debug_layer
echo 0x8800001f > /sys/module/acpi/parameters/debug_level
instead. :)
Comment 13 Benjamin Pineau 2007-11-07 05:07:40 UTC
Created attachment 13435 [details]
dmesg with new suggested mask

Hi, no problem with a patch for 2.6.21, this kernel exposes
the same behavior.

Here's what differs, in /sys/firmware/acpi/interrupts/stats
after a few minutes (during which powertop still showed acpi
activity but acpi_listen didn't), all other values stays at 0 :

-gpe_total 1405
+gpe_total 2386

-gpe28     1405
+gpe28     2386

This "gpe28" grows at the same time as the "IO-APIC-fasteoi acpi"
counter in /proc/interrupts (actually as the same value minus one).

Yes the rogues interrupts vanished after I unloaded the battery module.
And yes, they are triggered by some userland activity. Killing the usual
suspects (gnome-power-manager and powertop) didn't stop those interrupts,
but killing hal (0.5.9.1) did.

Stracing hald showed that a simple "cat /proc/acpi/ac_adapter/AC/state"
triggers two acpi interrupts (invisibles to acpi_listen), and increases
subsequently my "gpe28" counter by two (when running Len's patch).
Comment 14 Benjamin Pineau 2007-11-07 05:08:13 UTC
Created attachment 13436 [details]
/sys/firmware/acpi/interrupts/stats before
Comment 15 Benjamin Pineau 2007-11-07 05:08:51 UTC
Created attachment 13437 [details]
/sys/firmware/acpi/interrupts/stats after some time and a few more interrupts
Comment 16 Zhang Rui 2007-11-07 23:08:42 UTC
Hal keeps on polling the ACPI device status, thus triggers ACPI ec events.
acpi_listen only captures the acpi notifications exported to user space,
which is quite differnt from ACPI interrupts.
You can trigger ACPI interrupts by manually poking the AC/battery proc I/F, right?
Then I don't think this is a Linux/ACPI bug.

Benjamin,
can you resend the acpidump please? the one in comment #1 is broken.
Comment 17 Fu Michael 2007-11-18 21:59:52 UTC
Benjamin, please upload the acpidump output as requested in comment# 16. Please don't zip it, just attach the output as an attachment would be fine...
Comment 18 Benjamin Pineau 2007-11-19 08:56:45 UTC
Created attachment 13615 [details]
Plain text acpidump

Sorry I was afaik for a week. Here is the requested dump.

About comment #16 : Yes, I can trigger the same interrupts by hand, and yes it's triggered by userland activity. I'm not skilled and qualified to tell if it's a bug in Linux/ACPI, somewhere else, or not at all; I was just told by Len on IRC to report this behavior here (so we could better explore and understand what's happening: apparently we're done). Plus it's harmless. So feel free to close it (and/or to tell me if I should report something at hal's bt), sorry if I messed with your time.

PS: Len's 2.6.21 "acpi interrupts stats" patch (in comment #10) worked well here. If you need a tester for a forward port, just ask.
Comment 19 Benjamin Pineau 2007-11-19 08:57:25 UTC
Created attachment 13616 [details]
Same, but binary (acpidump -b)

Note You need to log in before you can comment on or make changes to this bug.