From patchwork Mon Dec 14 13:02:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Youquan Song X-Patchwork-Id: 67193 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nBE5R7pL017601 for ; Mon, 14 Dec 2009 05:27:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750859AbZLNF1G (ORCPT ); Mon, 14 Dec 2009 00:27:06 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750942AbZLNF1F (ORCPT ); Mon, 14 Dec 2009 00:27:05 -0500 Received: from mga09.intel.com ([134.134.136.24]:61109 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750859AbZLNF1E (ORCPT ); Mon, 14 Dec 2009 00:27:04 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 13 Dec 2009 21:26:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.47,393,1257148800"; d="scan'208";a="475699958" Received: from youquan-linux.bj.intel.com (HELO localhost) ([172.16.182.102]) by orsmga002.jf.intel.com with ESMTP; 13 Dec 2009 21:26:50 -0800 Date: Mon, 14 Dec 2009 08:02:33 -0500 From: "Youquan,Song" To: lenb@kernel.org Cc: venkatesh.pallipadi@intel.com, linux@dominikbrodowski.net, kent.liu@intel.com, chaohong.guo@intel.com, youquan.song@intel.com, linux-acpi@vger.kernel.org Subject: [PATCH]acpi c-states: Fix multiply C-states name disturbance Message-ID: <20091214130233.GA3898@youquan-linux.bj.intel.com> Mime-Version: 1.0 Content-Disposition: inline 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..a94b4d7 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, "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, "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, "C%d", + ACPI_STATE_C3); state->enter = pr->flags.bm_check ? acpi_idle_enter_bm : acpi_idle_enter_simple;