From patchwork Tue Jun 2 02:51:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaohua Li X-Patchwork-Id: 27370 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 n522q1Xh017372 for ; Tue, 2 Jun 2009 02:52:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755889AbZFBCv6 (ORCPT ); Mon, 1 Jun 2009 22:51:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755905AbZFBCv6 (ORCPT ); Mon, 1 Jun 2009 22:51:58 -0400 Received: from mga11.intel.com ([192.55.52.93]:18008 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755889AbZFBCv5 (ORCPT ); Mon, 1 Jun 2009 22:51:57 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 01 Jun 2009 19:45:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.41,288,1241420400"; d="scan'208";a="462458536" Received: from sli10-conroe.sh.intel.com (HELO sli10-desk.sh.intel.com) ([10.239.13.175]) by fmsmga002.fm.intel.com with ESMTP; 01 Jun 2009 19:46:08 -0700 Received: from david by sli10-desk.sh.intel.com with local (Exim 4.69) (envelope-from ) id 1MBK6Y-0005ea-NP; Tue, 02 Jun 2009 10:51:58 +0800 Date: Tue, 2 Jun 2009 10:51:58 +0800 From: Shaohua Li To: stable@kernel.org Cc: lenb@kernel.org, linux-acpi@vger.kernel.org Subject: [PATCH]make AMC C1E work in processor_idle Message-ID: <20090602025158.GA21337@sli10-desk.sh.intel.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Below two commits should go into 2.6.27 2.6.28 2.6.29 stable as suggested by Len. 87ad57bacb25c3f24c54f142ef445f68277705f0 7d60e8ab0d5507229dfbdf456501cc378610fa01 The first commit can't be applied, below patch is updated which should apply to the branches. The second commit can apply directly. When AMD C1E is enabled, local APIC timer will stop even in C1. This patch uses broadcast ipi to replace local APIC timer in C1. http://bugzilla.kernel.org/show_bug.cgi?id=13233 [ impact: avoid boot hang in AMD CPU with C1E enabled ] Tested-by: Dmitry Lyzhyn Signed-off-by: Shaohua Li --- drivers/acpi/processor_idle.c | 6 ++++++ 1 file changed, 6 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/drivers/acpi/processor_idle.c =================================================================== --- linux.orig/drivers/acpi/processor_idle.c 2009-06-02 09:27:53.000000000 +0800 +++ linux/drivers/acpi/processor_idle.c 2009-06-02 09:32:36.000000000 +0800 @@ -212,6 +212,9 @@ static void acpi_timer_check_state(int s struct acpi_processor_power *pwr = &pr->power; u8 type = local_apic_timer_c2_ok ? ACPI_STATE_C3 : ACPI_STATE_C2; + if (boot_cpu_has(X86_FEATURE_AMDC1E)) + type = ACPI_STATE_C1; + /* * Check, if one of the previous states already marked the lapic * unstable @@ -648,6 +651,7 @@ static int acpi_processor_power_verify(s switch (cx->type) { case ACPI_STATE_C1: cx->valid = 1; + acpi_timer_check_state(i, pr, cx); break; case ACPI_STATE_C2: @@ -871,12 +875,14 @@ static int acpi_idle_enter_c1(struct cpu return 0; } + acpi_state_timer_broadcast(pr, cx, 1); t1 = inl(acpi_gbl_FADT.xpm_timer_block.address); acpi_idle_do_entry(cx); t2 = inl(acpi_gbl_FADT.xpm_timer_block.address); local_irq_enable(); cx->usage++; + acpi_state_timer_broadcast(pr, cx, 0); return ticks_elapsed_in_us(t1, t2); }