From patchwork Wed Dec 16 16:06:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Youquan Song X-Patchwork-Id: 68311 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBI4ixlO005715 for ; Fri, 18 Dec 2009 04:45:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751186AbZLPIaj (ORCPT ); Wed, 16 Dec 2009 03:30:39 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761797AbZLPIaj (ORCPT ); Wed, 16 Dec 2009 03:30:39 -0500 Received: from mga09.intel.com ([134.134.136.24]:58544 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751186AbZLPIai (ORCPT ); Wed, 16 Dec 2009 03:30:38 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 16 Dec 2009 00:29:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.47,405,1257148800"; d="scan'208";a="476589816" Received: from youquan-linux.bj.intel.com (HELO localhost) ([172.16.182.102]) by orsmga002.jf.intel.com with ESMTP; 16 Dec 2009 00:30:21 -0800 Date: Wed, 16 Dec 2009 11:06:02 -0500 From: "Youquan,Song" To: lenb@kernel.org Cc: venkatesh.pallipadi@intel.com, "linux@dominikbrodowski.net" , "Liu, Kent" , "Guo, Chaohong" , "Song, Youquan" , "linux-acpi@vger.kernel.org" Subject: [Resend PATCH]acpi c-states: Fix multiply C-states name disturbance Message-ID: <20091216160602.GA32481@youquan-linux.bj.intel.com> References: <20091214130233.GA3898@youquan-linux.bj.intel.com> Mime-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 302d656..f14785d 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1086,7 +1086,6 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr) #endif cpuidle_set_statedata(state, cx); - snprintf(state->name, CPUIDLE_NAME_LEN, "C%d", i); strncpy(state->desc, cx->desc, CPUIDLE_DESC_LEN); state->exit_latency = cx->latency; state->target_residency = cx->latency * latency_factor; @@ -1099,6 +1098,8 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr) if (cx->entry_method == ACPI_CSTATE_FFH) state->flags |= CPUIDLE_FLAG_TIME_VALID; + snprintf(state->name, CPUIDLE_NAME_LEN, "ACPI C%d", + ACPI_STATE_C1); state->enter = acpi_idle_enter_c1; dev->safe_state = state; break; @@ -1106,6 +1107,8 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr) case ACPI_STATE_C2: state->flags |= CPUIDLE_FLAG_BALANCED; state->flags |= CPUIDLE_FLAG_TIME_VALID; + snprintf(state->name, CPUIDLE_NAME_LEN, "ACPI C%d", + ACPI_STATE_C2); state->enter = acpi_idle_enter_simple; dev->safe_state = state; break; @@ -1114,6 +1117,8 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr) state->flags |= CPUIDLE_FLAG_DEEP; state->flags |= CPUIDLE_FLAG_TIME_VALID; state->flags |= CPUIDLE_FLAG_CHECK_BM; + snprintf(state->name, CPUIDLE_NAME_LEN, "ACPI C%d", + ACPI_STATE_C3); state->enter = pr->flags.bm_check ? acpi_idle_enter_bm : acpi_idle_enter_simple;