Bug 465637 - C1 state unsupported on modern AMD mobiles
Summary: C1 state unsupported on modern AMD mobiles
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: rawhide
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-10-04 23:37 UTC by Jakub Jozwicki
Modified: 2009-04-30 08:49 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-04-26 09:03:58 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
C1 visible by powertop (3.77 KB, patch)
2008-10-06 07:08 UTC, Jakub Jozwicki
no flags Details | Diff
dmesg (48.64 KB, text/plain)
2008-10-11 21:36 UTC, Jakub Jozwicki
no flags Details
interrupts - time0 (1.25 KB, text/plain)
2008-10-11 21:37 UTC, Jakub Jozwicki
no flags Details
interrupts - time30 (1.25 KB, text/plain)
2008-10-11 21:38 UTC, Jakub Jozwicki
no flags Details

Description Jakub Jozwicki 2008-10-04 23:37:35 UTC
Description of problem:
Newer laptops with AMD Turion X2 and AMD Athlon X2 mobile processors (which are C1E capable) are overheating and have very degraded battery life due to bug in /usr/src/linux/drivers/acpi/processor_idle.c -> acpi_processor_get_power_info_fadt. The exact problem lies in "if (!pr->pblk)                 return -ENODEV;".
C1E replaces C2 and C3 states, so BIOS usually doesn't have definitions for _CST and PBLK in FADT - it is perfectly valid according to ACPI specification. When there is no PBLK its address is 0. In this situation acpi_processor_get_power_info_fadt returns error code which causes acpi_processor_get_power_info to disable C1/C1e. Instead of error there should be returned zero.

Version-Release number of selected component (if applicable):
all Linux kernels including not yet realeased 2.6.27

How reproducible: 
With modern Puma laptops, virtually always.

Steps to Reproduce:
1.Buy Acer Aspire 4530 or HP Pavilion or anything else which is based on AMD Puma platform or slightly order
2.Install Linux on it
3.Then compare temperatures and battery life with Vista. You will be very disappointed by Linux.
  
Actual results:
Linux on AMD laptops sucks.

Expected results:
Linux on AMD laptops rulez.

Additional info:
http://download.microsoft.com/download/0/0/b/00bba048-35e6-4e5b-a3dc-36da83cbb0d1/ProcPowerMgmt.docx
Evil always enables C1.

Comment 1 Jakub Jozwicki 2008-10-06 07:08:12 UTC
Created attachment 319520 [details]
C1 visible by powertop

With this patch we are sure that C1 is used, but it doesn't increase battery life drastically. The question (to AMD) is why? 2h comparing to 3h in Vista.

Comment 2 Chuck Ebbert 2008-10-10 07:59:01 UTC
Is the system going into tickless mode? What does /proc/interrupts tell you about how often the timer interrupt is happening? Also please attach /var/log/dmesg from booting the latest rawhide kernel (2.6.27-1 or later.)

Comment 3 Jakub Jozwicki 2008-10-11 21:36:27 UTC
Created attachment 320120 [details]
dmesg

Comment 4 Jakub Jozwicki 2008-10-11 21:37:35 UTC
Created attachment 320121 [details]
interrupts - time0

Comment 5 Jakub Jozwicki 2008-10-11 21:38:04 UTC
Created attachment 320122 [details]
interrupts - time30

Comment 6 Jakub Jozwicki 2008-10-11 21:45:55 UTC
here are screenshots with powertop:
http://jakub007.blogspot.com/2008/10/powertop-on-linux-2.html

http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/41256.pdf

Cited MSR for C1E is zero.

Comment 7 Bug Zapper 2008-11-26 03:33:35 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 8 Andreas Herrmann 2009-02-20 14:18:53 UTC
Current AMD dual-core CPUs don't support C2 and C3. Instead C1E is used.
C1 is automatically used when core enters halt().

If both cores are in halt (or C1 state) C1E is entered if configured by
BIOS.

So if your system (BIOS) does not setup C1E, I assume that it is not
used under Windows as well.

Thus the different power consumption has a different root
cause. One possible culprit for decreased battery life can be
different graphic card drivers used under Linux and Windows.

Comment 9 Jakub Jozwicki 2009-02-20 23:30:14 UTC
If I had enabled C1E by BIOS in Windows how much would be battery life increased?
Can I reprogram MSR001_0055 on early kernel init?
What should I write into it among bits 28 and 26?
Can acpi_osi trigger C1E configuration?

Comment 10 Andreas Herrmann 2009-04-24 16:14:11 UTC
> If I had enabled C1E by BIOS in Windows how much would
> be battery life increased?

AFAIK several AMD CPU family 0x11 systems are using CLMC.
See "AMD Family 11h Processor BKDG", section "2.4.3.1 C1 Enhanced State (C1E)"
C1E is not supported when CLMC is used by the IO Hub.

CLMC is used for power management, too.
I don't expect huge differences in power consumption.
I don't have numbers at hand, though.

> Can I reprogram MSR001_0055 on early kernel init?

Sure in general you can change MSRs. You also can change MSRs
using /dev/cpu/X/msr interface after the system is up and running.
But you can really screw up your system when writing the
wrong values to an MSR.

> What should I write into it among bits 28 and 26?

Don't modify it. The BIOS should know how to set these bits.

> Can acpi_osi trigger C1E configuration?

Do you mean acpi_osi kernel parameter?

Comment 11 Jakub Jozwicki 2009-04-26 09:03:58 UTC
I will never again buy any AMD product

Comment 12 Andreas Herrmann 2009-04-28 05:57:11 UTC
> I will never again buy any AMD product

That's unfortunate.

Hope that has nothing to do with my last comment.
In that I just wanted to point out that it is waste of time to try to
activate C1E (due to CLMC).

Regards,
Andreas

Comment 13 Jakub Jozwicki 2009-04-29 08:14:10 UTC
HyperTransport specification in chapter 8.6 says that CLMC works only on single core CPU and I have dual core CPU. CLMC is about HT power management, not about CPU power management.

Comment 14 Jakub Jozwicki 2009-04-29 22:20:04 UTC
> Unfortunately that information is under a Non-Disclosure Agreement (NDA) and is > not available for the public. If you want NDA access, please contact your local > AMD office and request NDA access.

> http://www.amd.com/us-en/Corporate/AboutAMD/0,,51_52_502,00.html#Europe

People need to sign NDA just to learn that to enable C1E they must put
in arch/x86/kernel/cpu/amd.c line: 
wrmsrl(0xC0010055, 0x0000000014C11015);

After that patched 2.6.30-rc3 hangs during boot, workaround is 'nolapic'.
That proves that AMD hardware is broken.

I wonder if reworked FADT and CST with hand made C2 and C3 would work.

Comment 15 Jakub Jozwicki 2009-04-30 08:49:53 UTC
Patched C1E + acpi=ht boots fine. Why ACPI hangs laptop?


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