Bug 4763 - loading of acpi processor.ko module hangs/freezes system instantly
Summary: loading of acpi processor.ko module hangs/freezes system instantly
Status: CLOSED CODE_FIX
Alias: None
Product: ACPI
Classification: Unclassified
Component: Config-Processors (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Shaohua
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-19 16:35 UTC by Samuel Berner
Modified: 2005-08-03 20:26 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.11.11
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
dmesg -s40000 (15.22 KB, text/plain)
2005-06-19 17:13 UTC, Samuel Berner
Details
dmidecode (9.53 KB, text/plain)
2005-06-19 17:14 UTC, Samuel Berner
Details
acpidmp (80.29 KB, text/plain)
2005-06-19 17:16 UTC, Samuel Berner
Details
lscpi -vv (8.82 KB, text/plain)
2005-06-19 17:16 UTC, Samuel Berner
Details
patch to blacklist C3 (1.21 KB, patch)
2005-06-22 18:37 UTC, Shaohua
Details | Diff
tweaked patch (1.52 KB, patch)
2005-07-29 14:47 UTC, Len Brown
Details | Diff

Description Samuel Berner 2005-06-19 16:35:15 UTC
Distribution: Gentoo Linux (Vanilla Kernel)

Hardware Environment:
Architecture: X86
Name: Clevo 5600D 
CPU: Pentium4 2.8 GHz, 533MHz FSB
This is a Laptop I bought in December 2002.
It was sold under many brands like Sager/Eurocom/Alienware/Promedion 56XX and
888X, Alienware m51, Littlebit 64X)

Software Environment:
not really relevant here, I think.


Problem Description:

Somewhere in February/March 2004 I first tried to build a kernel with working
ACPI support.
The standard kernel, freezed at startup when ACPI was enabled.
I then used the acpi-20040211-2.4.25.diff patch and I got a working kernel with
ACPI working perfectly.

In November/December 2004 I tried first to upgrade to 2.6 (2.6.9 maybe), both
unpatched and patched with the newest ACPI patches led to a system freeze during
system boot.
I also tried the same with a 2.4 kernel which gave me the same results.
As I hadn't too much time back then, I just used the old patch again, which
still worked on a gentoo-sources-2.4.25 (instead of a vanilla kernel).

Now I have some time and I'd like to solve problem finally:

The first what I did, was downloading one of the latests vanilla kernels
(2.6.11.11) through portage (gentoo package management tool).

I still freezed on startup (except if I passed the kernel parameter acpi=off).

I changed the kernel config to turn as many options as possible into modules.
So I got the modules ac.ko, button.ko, battery.ko, processor.ko and thermal.ko.

Booting the system worked fine now, including ACPI support.
Then I inserted one module after the other. First ac, then button, then battery
and all worked well until here (I tested them all over the /proc interface, they
all worked like in my previous kernel, I also found no suspicous lines in the
syslog (most useful kernel and all ACPI debugging options were compiled in))

When I inserted the processor.ko module the system freezed instantly (before I
could type any further characters on the terminal, but a new shell prompt was
there).


Steps to reproduce:
1. Boot up system with processor acpi support compiled into a module
2. load processor.ko module
3. System has freezed instantly.


As it seems to me. The problem in the acpi cpu code, that makes my laptop
freeze, was very likely introduced sometime in 2004.

I have good experience in C (and also C++), but none in kernel programming. So I
 would look at the source if you could give me some hints where the problem most
likely could be found (and maybe where I could find some general kernel
debugging tips).

Thank you for any help.
Comment 1 Samuel Berner 2005-06-19 17:13:09 UTC
Created attachment 5192 [details]
dmesg -s40000

from kernel 2.6.11.11 immedeately after a system boot
Comment 2 Samuel Berner 2005-06-19 17:14:35 UTC
Created attachment 5193 [details]
dmidecode

created under the same conditions as the attachment before
Comment 3 Samuel Berner 2005-06-19 17:16:05 UTC
Created attachment 5194 [details]
acpidmp

created under the same conditions as the attachment before
Comment 4 Samuel Berner 2005-06-19 17:16:45 UTC
Created attachment 5195 [details]
lscpi -vv

created under the same conditions as the attachment before
Comment 5 Shaohua 2005-06-19 18:31:14 UTC
I guess it's the bad of CST. Please try load processor module with 
parameter 'nocst=1'.
Comment 6 Samuel Berner 2005-06-20 12:23:42 UTC
I tried it twice. with that parameter:
- the first time it freezed immediately (using "modprobe processor nocst=1"
(quotes for clarity))
- the second time it freezed about 3-5 seconds after loading the module ( I used
insmod here, because I wasn't entirely sure if the first attempt was correct
(altough it must have been acording to the manpage))
("insmod /lib/modules/.../acpi/processor.ko nocst=1" (again quotes for clarity))

Any other ideas?
Comment 7 Shaohua 2005-06-20 17:50:47 UTC
Ok, how about the parameter 'max_cstate=1'? You can try different value such 
as 2,3 for the parameter.
Comment 8 Samuel Berner 2005-06-21 11:54:45 UTC
max_cstate=1 worked

max_cstate=2 worked also (I tested the /proc/acpi/processor interface both times)

max_cstate=3 makes my system freeze (after a few seconds)

The BIOS has a setting for the C3 state, which I have enabled a long time ago.
But my old kernel didn't seem to use it.

Do you think this is a hardware problem? Or would it probably be possible to get
the C3 state working?
Comment 9 Shaohua 2005-06-21 18:41:49 UTC
We possibly can't make your C3 work. Did your system work in WinXP (sorry)? 
It's more likely a BIOS bug to me. C3 is actually sample, it just reads an IO 
port, and your system hangs when reading the IO port. I think we should 
blacklist C3 in this system.
Comment 10 Samuel Berner 2005-06-22 07:18:03 UTC
I have a W2K partition I can boot into. But I don't know how I could find out if
W2K is really using the C3 state.
Can you give me advice how I could do that? Do I need a special tool for that?
Thanks.
Comment 11 Shaohua 2005-06-22 18:37:38 UTC
Created attachment 5205 [details]
patch to blacklist C3

No, there isn't any tool to do this. If win doesn't hang, we can't make any
conclusion.
I think it's not worthy digging this out. IIRC, only mobile CPU (Pentium M) has
C3 support. P4's C3 might not be a real C3. Blacklist C3 on this system should
have no impact. Could you please try the patch? Thanks!
Comment 12 Samuel Berner 2005-06-23 12:14:15 UTC
Ok. I've applied the patch, compiled all acpi modules into the kernel image,
booted from it and it works.

Thank you for your help.
Comment 13 Len Brown 2005-07-29 14:47:21 UTC
Created attachment 5412 [details]
tweaked patch

updated patch to re-name no_c2c3() to be set_max_cstate().
applied to-linus
Comment 14 Len Brown 2005-08-03 20:26:25 UTC
shipped in 2.6.13-rc5 -- closing.

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