From patchwork Sat Jan 23 06:38:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Chiang X-Patchwork-Id: 43669 X-Patchwork-Delegate: apw@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 2F2E0B7CE4 for ; Tue, 26 Jan 2010 11:11:44 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1NZZ1s-00045R-9Q; Tue, 26 Jan 2010 00:11:36 +0000 Received: from smarty.dreamhost.com ([208.113.175.8]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1NYZdS-0006SV-5t for kernel-team@lists.ubuntu.com; Sat, 23 Jan 2010 06:38:18 +0000 Received: from digdug.dreamhost.com (digdug.dreamhost.com [208.113.237.2]) by smarty.dreamhost.com (Postfix) with ESMTP id 9B5E068406F; Fri, 22 Jan 2010 22:38:17 -0800 (PST) Received: by digdug.dreamhost.com (Postfix, from userid 21683) id 98005B47D6; Fri, 22 Jan 2010 22:38:17 -0800 (PST) Date: Fri, 22 Jan 2010 22:38:17 -0800 From: Alex Chiang To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/2] ACPI: enable C2 and Turbo-mode on Nehalem notebooks on A/C Message-ID: <20100123063817.GB28826@digdug.dreamhost.com> References: <20100123063521.GA28826@digdug.dreamhost.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100123063521.GA28826@digdug.dreamhost.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Mailman-Approved-At: Tue, 26 Jan 2010 00:11:34 +0000 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com From: Len Brown upstream commit 5d76b6f6c17572e662f5c99c2023adae92100855 Linux has always ignored ACPI BIOS C2 with exit latency > 100 usec, and the ACPI spec is clear that is correct FADT-supplied C2. However, the ACPI spec explicitly states that _CST-supplied C-states have no latency limits. So move the 100usec C2 test out of the code shared by FADT and _CST code-paths, and into the FADT-specific path. This bug has not been visible until Nehalem, which advertises a CPU-C2 worst case exit latency on servers of 205usec. That (incorrect) figure is being used by BIOS writers on mobile Nehalem systems for the AC configuration. Thus, Linux ignores C2 leaving just C1, which is saves less power, and also impacts performance by preventing the use of turbo mode. OriginalAuthor: Len Brown OriginalLocation: http://bugzilla.kernel.org/show_bug.cgi?id=15064 Tested-by: Alex Chiang Signed-off-by: Len Brown Signed-off-by: Alex Chiang --- drivers/acpi/processor_idle.c | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 853bdb1..d1a9332 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -303,6 +303,17 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) pr->power.states[ACPI_STATE_C2].latency = acpi_gbl_FADT.C2latency; pr->power.states[ACPI_STATE_C3].latency = acpi_gbl_FADT.C3latency; + /* + * FADT specified C2 latency must be less than or equal to + * 100 microseconds. + */ + if (acpi_gbl_FADT.C2latency > ACPI_PROCESSOR_MAX_C2_LATENCY) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, + "C2 latency too large [%d]\n", acpi_gbl_FADT.C2latency)); + /* invalidate C2 */ + pr->power.states[ACPI_STATE_C2].address = 0; + } + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "lvl2[0x%08x] lvl3[0x%08x]\n", pr->power.states[ACPI_STATE_C2].address, @@ -499,16 +510,6 @@ static void acpi_processor_power_verify_c2(struct acpi_processor_cx *cx) return; /* - * C2 latency must be less than or equal to 100 - * microseconds. - */ - else if (cx->latency > ACPI_PROCESSOR_MAX_C2_LATENCY) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "latency too large [%d]\n", cx->latency)); - return; - } - - /* * Otherwise we've met all of our C2 requirements. * Normalize the C2 latency to expidite policy */