From patchwork Mon May 11 01:35:57 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Rui" X-Patchwork-Id: 22833 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4B1ZTC3015160 for ; Mon, 11 May 2009 01:35:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756869AbZEKBf0 (ORCPT ); Sun, 10 May 2009 21:35:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756978AbZEKBf0 (ORCPT ); Sun, 10 May 2009 21:35:26 -0400 Received: from mga01.intel.com ([192.55.52.88]:52976 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756869AbZEKBf0 (ORCPT ); Sun, 10 May 2009 21:35:26 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 10 May 2009 18:24:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.40,325,1239001200"; d="scan'208";a="455868987" Received: from rzhang-dt.sh.intel.com (HELO [10.239.36.94]) ([10.239.36.94]) by fmsmga002.fm.intel.com with ESMTP; 10 May 2009 18:29:59 -0700 Subject: [PATCH 1/2] ACPI processor: introduce module parameter processor.ignore_tpc From: Zhang Rui To: Len Brown Cc: linux-acpi , "Zhang, Rui" , theholyettlz@googlemail.com Date: Mon, 11 May 2009 09:35:57 +0800 Message-Id: <1242005757.15284.119.camel@rzhang-dt> Mime-Version: 1.0 X-Mailer: Evolution 2.22.1 (2.22.1-2.fc9) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Introduce module parameter processor.ignore_tpc. Some laptops are shipped with buggy _TPC implemented, this module parameter is used to workaround this kind of issues. http://bugzilla.kernel.org/show_bug.cgi?id=13259 Signed-off-by: Zhang Rui Tested-by: James Ettle --- drivers/acpi/processor_throttling.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6/drivers/acpi/processor_throttling.c =================================================================== --- linux-2.6.orig/drivers/acpi/processor_throttling.c +++ linux-2.6/drivers/acpi/processor_throttling.c @@ -45,6 +45,16 @@ #define _COMPONENT ACPI_PROCESSOR_COMPONENT ACPI_MODULE_NAME("processor_throttling"); +/* ignore_tpc: + * 0 -> acpi processor driver doesn't ignore _TPC values + * 1 -> acpi processor driver ignores _TPC values + */ +static int ignore_tpc; +module_param(ignore_tpc, int, 0644); +MODULE_PARM_DESC(ignore_tpc, "If the processor throttling state of your machine gets wrongly" \ + "limited by BIOS, this should help"); + + struct throttling_tstate { unsigned int cpu; /* cpu nr */ int target_state; /* target T-state */ @@ -283,6 +293,10 @@ static int acpi_processor_get_platform_l if (!pr) return -EINVAL; + + if (ignore_tpc) + goto end; + status = acpi_evaluate_integer(pr->handle, "_TPC", NULL, &tpc); if (ACPI_FAILURE(status)) { if (status != AE_NOT_FOUND) { @@ -290,6 +304,8 @@ static int acpi_processor_get_platform_l } return -ENODEV; } + +end: pr->throttling_platform_limit = (int)tpc; return 0; } @@ -302,6 +318,9 @@ int acpi_processor_tstate_has_changed(st struct acpi_processor_limit *limit; int target_state; + if (ignore_tpc) + return 0; + result = acpi_processor_get_platform_limit(pr); if (result) { /* Throttling Limit is unsupported */