From patchwork Thu Jul 22 21:21:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 113771 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6MLMCns020745 for ; Thu, 22 Jul 2010 21:22:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753729Ab0GVVWJ (ORCPT ); Thu, 22 Jul 2010 17:22:09 -0400 Received: from vms173013pub.verizon.net ([206.46.173.13]:63954 "EHLO vms173013pub.verizon.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751507Ab0GVVWI (ORCPT ); Thu, 22 Jul 2010 17:22:08 -0400 Received: from localhost.localdomain ([unknown] [64.140.212.33]) by vms173013.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0L5Z004YZA0ABEF6@vms173013.mailsrvcs.net>; Thu, 22 Jul 2010 16:21:52 -0500 (CDT) Received: from localhost.localdomain (x980 [127.0.0.1]) by localhost.localdomain (8.14.4/8.14.4) with ESMTP id o6MLLjsM012886; Thu, 22 Jul 2010 17:21:45 -0400 Received: from localhost (lenb@localhost) by localhost.localdomain (8.14.4/8.14.4/Submit) with ESMTP id o6MLLgdf012881; Thu, 22 Jul 2010 17:21:43 -0400 X-Authentication-warning: localhost.localdomain: lenb owned process doing -bs Date: Thu, 22 Jul 2010 17:21:42 -0400 (EDT) From: Len Brown X-X-Sender: lenb@localhost.localdomain To: Andi Kleen Cc: Matthew Garrett , "Yu, Luming" , Philip Langdale , Jeff Garrett , Linux Kernel Mailing List , "linux-acpi@vger.kernel.org" , "venki@google.com" Subject: [PATCH] ACPI: skip checking BM_STS if the BIOS doesn't ask for it In-reply-to: Message-id: References: <20100427124703.GA16706@jgarrett.org> <20100430174447.GA14889@srcf.ucam.org> <20100525124325.GC7876@srcf.ucam.org> <20100525185507.GA15997@srcf.ucam.org> <20100722074750.GA22520@one.firstfloor.org> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-version: 1.0 Content-type: TEXT/PLAIN; charset=US-ASCII Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 22 Jul 2010 21:22:13 +0000 (UTC) diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c index 2e837f5..fb7a5f0 100644 --- a/arch/x86/kernel/acpi/cstate.c +++ b/arch/x86/kernel/acpi/cstate.c @@ -145,6 +145,15 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu, percpu_entry->states[cx->index].eax = cx->address; percpu_entry->states[cx->index].ecx = MWAIT_ECX_INTERRUPT_BREAK; } + + /* + * For _CST FFH on Intel, if GAS.access_size bit 1 is cleared, + * then we should skip checking BM_STS for this C-state. + * ref: "Intel Processor Vendor-Specific ACPI Interface Specification" + */ + if ((c->x86_vendor == X86_VENDOR_INTEL) && !(reg->access_size & 0x2)) + cx->bm_sts_skip = 1; + return retval; } EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe); diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index b1b3856..b351342 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -947,7 +947,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, if (acpi_idle_suspend) return(acpi_idle_enter_c1(dev, state)); - if (acpi_idle_bm_check()) { + if (!cx->bm_sts_skip && acpi_idle_bm_check()) { if (dev->safe_state) { dev->last_state = dev->safe_state; return dev->safe_state->enter(dev, dev->safe_state); diff --git a/include/acpi/processor.h b/include/acpi/processor.h index da565a4..a68ca8a 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -48,7 +48,7 @@ struct acpi_power_register { u8 space_id; u8 bit_width; u8 bit_offset; - u8 reserved; + u8 access_size; u64 address; } __attribute__ ((packed)); @@ -63,6 +63,7 @@ struct acpi_processor_cx { u32 power; u32 usage; u64 time; + u8 bm_sts_skip; char desc[ACPI_CX_DESC_LEN]; };