Bug 9488

Summary: cpu locked at 800MHz due to _PPC - FSC Lifebook E8410 Core2Duo 2.4GHz
Product: ACPI Reporter: Michael Reinelt (michael)
Component: Power-ProcessorAssignee: ykzhao (yakui.zhao)
Status: CLOSED CODE_FIX    
Severity: normal CC: acpi-bugzilla, michael, trenn
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.24-rc3 Subsystem:
Regression: --- Bisected commit-id:
Attachments: ACPI dump
acpi dumps as requested
dmesg output
test the debug patch
syslog with cpufreq.debug=7 and PPC debug
dmesg output

Description Michael Reinelt 2007-12-01 22:14:01 UTC
Most recent kernel where this bug did not occur: unknown
Distribution: Debian
Hardware Environment: Fujitsu-Siemens Lifebook E8410 with Core2Duo@2.4GHz
Software Environment: single-user mode
Problem Description: when loading acpi-cpufreq (with no other daemons running), the system will reduce CPU frequency, but never increase it, probably due to wrong _PPC values

Steps to reproduce: boot into single-user mode, load acpi-cpufreq, change governor to 'ondemand' => cpu frequency will step down to 800 MHz, but will never be increased again (not even under heavy load). Adding a debug patch from http://article.gmane.org/gmane.linux.kernel.cpufreq/5642 shows that _PPC values increase as P-states are entered.
Comment 1 Michael Reinelt 2007-12-01 22:16:40 UTC
Created attachment 13823 [details]
ACPI dump

Thomas Renninger asked me to add a acpi dump
Comment 2 ykzhao 2007-12-03 00:31:31 UTC
Will you please attach the info using the following commands?
acpidump --addr 0xcf6dfdd2 --length 0x2bc -o cpu0ist
acpidump --addr 0xcf6e021a --length 0xb8  -o cpu1ist
acpidump --addr 0xcf6e02d2 --length 0x463 -o cpu0cst
acpidump --addr 0xcf6e0740 --length 0x47  -o cpu1cst
Thanks.
Comment 3 Michael Reinelt 2007-12-03 00:39:43 UTC
Created attachment 13835 [details]
acpi dumps as requested
Comment 4 Thomas Renninger 2007-12-05 06:02:02 UTC
The third length is wrong:
acpidump --addr 0xcf6e02d2 --length 0x463 -o cpu0cst
should be:
acpidump --addr 0xcf6e02d2 --length 0x46E -o cpu0cst

But anyway, this rather hard to debug. There are several functions playing with _PPC.
E.g.:
 - TCTR
 - TPTS
 - TWAK
 - ...

But when, why and whether it is intended that _PPC is increased is hard to debug. Maybe you should start with a BIOS update and going through your BIOS settings then. Search for anything related to speedstep/cpufreq/cpu power policy or whatever.
Comment 5 ykzhao 2007-12-10 01:55:18 UTC
Hi, Michael
Thanks for the info. 
Will you please enable the debug function of cpufreq amd acpi in kernel configuration and boot the system with the option of acpi.debug_layer=0x01000000 acpi.debug_level=0x1f? 
After the system is booted and acpi_cpufreq driver is loaded, echo 2 > /sys/module/cpufreq/parameters/debug and echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor.

After the above is executed, do the folliwng actions.
a. cd /sys/devices/system/cpu/cpu/cpu0/cpufreq
b. cat scaling_max_freq > scaling_setspeed
c. cat 1600000 > scaling_setspeed
d. attach the output of dmesg.
Thanks.
 
Comment 6 Michael Reinelt 2007-12-21 23:26:55 UTC
I executed the above steps, see attached dmesg output. From what I can see, I don't think it will be of much help :-(

as soon as I loaded the acpi_cpufreq module, frequency goes down from 2.4 GHz to 2 GHz, and scaling_max_frequency is at 2000000, too (while cpuinfo_max_freq stays at 2400000).

To answer Thomas' questions: I already installed the latest BIOS 1.08 from Fujitsu Siemens; and there is only one BIOS setting regarding SpeedStep, If I disable SpeedStep at all, I can't even load the acpi_cpufreq module
Comment 7 Michael Reinelt 2007-12-21 23:28:20 UTC
Created attachment 14145 [details]
dmesg output
Comment 8 ykzhao 2007-12-26 22:09:00 UTC
Created attachment 14200 [details]
test the debug patch
Comment 9 ykzhao 2007-12-26 22:23:17 UTC
 >acpi-cpufreq: acpi_cpufreq_target 1600000 (0)
From the log in comment #7 it seems that this is a cpufreq-governor/policy problem  rather than _PPC problem.
Will you please try the debug patch in comment #7 and boot the system with the option of cpufreq.debug=7?
Thanks.
Comment 10 Michael Reinelt 2007-12-27 22:36:53 UTC
I applied ykzhao's debug patch, and booted with cpufreq.debug=7, see attached syslog.

Note that the first "PPC limit is 1" message appears *before* acpi_cpufreq was loaded!
Comment 11 Michael Reinelt 2007-12-27 22:37:52 UTC
Created attachment 14213 [details]
syslog with cpufreq.debug=7 and PPC debug
Comment 12 ykzhao 2007-12-28 23:09:36 UTC
HI, Michael
Thanks for you log.
From the logs in comment #7 and #11 it seems that the system can work well when the governor of performance or userspace is used. 

Will you please try the following test after the system is booted?
a. echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
b. After about ten minutes , please attach the output of dmesg. The system load had better be increased or decreased frequently in the test.
Of course the debug patch and boot option of pufreq.debug=7 are still required.

Thanks.
Comment 13 Thomas Renninger 2007-12-29 04:49:59 UTC
> Note that the first "PPC limit is 1" message appears *before* acpi_cpufreq
> was loaded!
That looks normal. Your BIOS provides really strange values, but it should work:
merlin kernel: acpi-cpufreq:      *P0: 2401 MHz, 35000 mW, 10 uS
merlin kernel: acpi-cpufreq:       P1: 2400 MHz, 35000 mW, 10 uS
merlin kernel: acpi-cpufreq:       P2: 2000 MHz, 28000 mW, 10 uS
merlin kernel: acpi-cpufreq:       P3: 1600 MHz, 22000 mW, 10 uS
merlin kernel: acpi-cpufreq:       P4: 1200 MHz, 16000 mW, 10 uS
merlin kernel: acpi-cpufreq:       P5: 800 MHz, 14000 mW, 10 uS
The first (2401 MHz) seem to be some kind of dummy. The BIOS tells the OS to not use it by passing _PPC == 1.
This is rather obscure and I could imagine the problem is somehow related.

From comment #5 and #6 (and dmesg from comment #7):
> as soon as I loaded the acpi_cpufreq module, frequency goes down from 2.4 GHz
> to 2 GHz, and scaling_max_frequency is at 2000000, too...
There already something goes wrong:
  - From dmesg, cpufreq layer still seem to think it's at 2.4 (better pass
    cpufreq.debug=7 as boot parameter, instead of
    echo 2 >/sys/module/cpufreq/parameters/debug
    If something goes wrong at driver load time, we might see it then)


You might already want to try this quick shot and revert this patch:
commit 0916bd3ebb7cefdd0f432e8491abe24f4b5a101e
(Copy and Pasted):
index 5207f9e..cbb6f08 100644 (file)
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -322,10 +322,6 @@ static int acpi_processor_get_performance_info(struct acpi_processor *pr)
        if (result)
                return result;
 
-       result = acpi_processor_get_platform_limit(pr);
-       if (result)
-               return result;
-
        return 0;
 }


This patch invokes _PPC at cpufreq init time, maybe it is needed on your machine, for more details:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=e4233dec749a3519069d9390561b5636a75c7579

Anyway, the info ykzhao requested in comment #12 would also be very helpful, but better use cpufreq.debug=7 boot parameter to enable cpufreq debug.
Comment 14 Michael Reinelt 2007-12-30 22:34:42 UTC
Created attachment 14232 [details]
dmesg output

dmesg output, booted with cpufreq.debug=7 and acpi.debug_layer=0x01000000
acpi.debug_level=0x1f

The system was idle after boot, at 07:16:00 I run two instances of cpuburn (burnP6) in parallel. As you can see from dmesg, the cpu is already at 800 MHz and the frequency will not increase (in fact, nothing happens in dmesg after 07:15:30)

next I will give Thomas' patch a try, and post the dmesg here again.
Comment 15 Michael Reinelt 2007-12-30 23:09:02 UTC
I reverted the patch from comment #13 as supposed by Thomas, but it didn't help. Same behaviour as before (PPC increases, frequency decreases and will never increase again)

But I found a very quick and dirty solution for my problem: I applied the "ignore_ppc" patch from http://www.mail-archive.com/linux-acpi@vger.kernel.org/msg06781.html and added the ignore_ppc option, now my system works as expected! I get clean frequency scaling.

Anyway, I know that this not a generic solution, So I'm willing to to some more debugging and testing...
Comment 16 Len Brown 2008-01-01 10:43:16 UTC
re: processor.ignore_ppc

Wups, looks like I dropped that one and it is indeed useful:-(
Thomas, is it okay if i call it processor.noppc to be consistent
with the existing processor.nocst?

re: P0: 2401 MHz, P1: 2400 MHz

This is the mechanism to enable Intel Dynamic Acceleration Technology
on processors that support it. eg. the processor is guaranteed to be
able to do 2400 MHz, but may be able to run faster if the system provides
thermal and electrical headroom.

As there is no guarantee that P0 will be any faster than P1,
a 1MHz delta is used to describe the opportunistic upside.

Please check if there are any BIOS SETUP options related to this,
or processor power management in general.  Also, please paste
the contents of /proc/cpuinfo
Comment 17 ykzhao 2008-01-02 21:43:03 UTC
HI, Michael
   From the above logs it seems that the problem is related with the _PPC value and is caused by the broken BIOS. 
   With the increment of _PPC limit, the cpufreq is decreased. But the _PPC value can't be decreased, so it seems that the cpu is locked at the 800MHz(the lowest performance P-state).
   
   It is appropriate to fix this issue by bios update. Of course it can be fixed by workaround patch(adding the module parameter of processor.noppc).
Comment 18 Len Brown 2008-06-13 21:42:29 UTC
workaround shipped in 2.6.25-rc1 - closed.

commit 623b78c39c4525731f852072edd742cc4fba6786
Author: Thomas Renninger <trenn@suse.de>
Date:   Fri May 18 21:59:28 2007 -0500

    ACPI: add "processor.ignore_ppc" hook to workaround BIOS _PPC weirdness