From: akpm@linux-foundation.org Subject: [patch 2/8] acpi: enable C3 Power State on Dell Inspiron 8200 Date: Tue, 02 Oct 2007 13:24:07 -0700 Message-ID: <200710022024.l92KO7wM020456@imap1.linux-foundation.org> Return-path: Received: from smtp2.linux-foundation.org ([207.189.120.14]:46859 "EHLO smtp2.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752929AbXJBUY6 (ORCPT ); Tue, 2 Oct 2007 16:24:58 -0400 Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: lenb@kernel.org Cc: linux-acpi@vger.kernel.org, akpm@linux-foundation.org, arjan@infradead.org, dag@bakke.com From: Arjan van de Ven Taken from http://bugzilla.kernel.org/show_bug.cgi?id=8703 Cc: Dag Bakke Cc: Len Brown Signed-off-by: Andrew Morton --- drivers/acpi/processor_idle.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff -puN drivers/acpi/processor_idle.c~acpi-enable-c3-power-state-on-dell-inspiron-8200 drivers/acpi/processor_idle.c --- a/drivers/acpi/processor_idle.c~acpi-enable-c3-power-state-on-dell-inspiron-8200 +++ a/drivers/acpi/processor_idle.c @@ -72,6 +72,8 @@ module_param(max_cstate, uint, 0644); static unsigned int nocst __read_mostly; module_param(nocst, uint, 0000); +static int forced_c3; + /* * bm_history -- bit-mask with a bit per jiffy of bus-master activity * 1000 HZ: 0xFFFFFFFF: 32 jiffies = 32ms @@ -106,6 +108,20 @@ static int set_max_cstate(struct dmi_sys return 0; } +/* + * Some (Dell) machines have a too large C3 latency set, but it still works completely. + * Dell provides a driver for other operating systems to hack around this bug, so we know + * it's safe. + */ +static int dmi_force_c3(struct dmi_system_id *id) +{ + forced_c3 = 1; + + printk(KERN_NOTICE PREFIX "%s detected - Force enabling C3.", id->ident); + + return 0; +} + /* Actually this shouldn't be __cpuinitdata, would be better to fix the callers to only run once -AK */ static struct dmi_system_id __cpuinitdata processor_power_dmi_table[] = { @@ -164,6 +180,9 @@ static struct dmi_system_id __cpuinitdat DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"), DMI_MATCH(DMI_BIOS_VERSION,"SHE845M0.86C.0013.D.0302131307")}, (void *)2}, + { dmi_force_c3, "Dell Inspiron 8200", { + DMI_MATCH(DMI_SYS_VENDOR,"Dell Computer Corporation"), + DMI_MATCH(DMI_PRODUCT_NAME,"Inspiron 8200") }, NULL}, {}, }; @@ -975,11 +994,12 @@ static void acpi_processor_power_verify_ * C3 latency must be less than or equal to 1000 * microseconds. */ - else if (cx->latency > ACPI_PROCESSOR_MAX_C3_LATENCY) { + if (cx->latency > ACPI_PROCESSOR_MAX_C3_LATENCY && !forced_c3) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "latency too large [%d]\n", cx->latency)); return; - } + } else if (forced_c3) + cx->latency = ACPI_PROCESSOR_MAX_C3_LATENCY; /* * PIIX4 Erratum #18: We don't support C3 when Type-F (fast) _