From patchwork Thu Apr 23 23:18:32 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 19710 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 n3NNIate028224 for ; Thu, 23 Apr 2009 23:18:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752286AbZDWXSf (ORCPT ); Thu, 23 Apr 2009 19:18:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752528AbZDWXSf (ORCPT ); Thu, 23 Apr 2009 19:18:35 -0400 Received: from vms173019pub.verizon.net ([206.46.173.19]:48819 "EHLO vms173019pub.verizon.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752286AbZDWXSe (ORCPT ); Thu, 23 Apr 2009 19:18:34 -0400 Received: from localhost.localdomain ([96.237.168.40]) by vms173019.mailsrvcs.net (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPA id <0KIK007KKU2XKA02@vms173019.mailsrvcs.net>; Thu, 23 Apr 2009 18:18:34 -0500 (CDT) Received: from localhost.localdomain (d975xbx2 [127.0.0.1]) by localhost.localdomain (8.14.2/8.14.2) with ESMTP id n3NNIWsZ032556; Thu, 23 Apr 2009 19:18:32 -0400 Received: from localhost (lenb@localhost) by localhost.localdomain (8.14.2/8.14.2/Submit) with ESMTP id n3NNIWvx032552; Thu, 23 Apr 2009 19:18:32 -0400 X-Authentication-warning: localhost.localdomain: lenb owned process doing -bs Date: Thu, 23 Apr 2009 19:18:32 -0400 (EDT) From: Len Brown X-X-Sender: lenb@localhost.localdomain To: Venkatesh Pallipadi Cc: Linux Kernel Mailing List , linux-acpi@vger.kernel.org, x86@kernel.org Subject: [PATCH] ACPI/hpet: prevent boot hang when hpet=force used on ICH-4M In-reply-to: Message-id: References: User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-version: 1.0 Content-type: TEXT/PLAIN; charset=US-ASCII Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Len Brown Linux tells ICH4 users that they can (manually) invoke "hpet=force" to enable the undocumented ICH-4M HPET. The HPET becomes available for both clocksource and clockevents. But as of ff69f2bba67bd45514923aaedbf40fe351787c59 (acpi: fix of pmtimer overflow that make Cx states time incorrect) the HPET may be used via clocksource for idle accounting, and hpet=force on an ICH4 box hangs boot. It turns out that touching the MMIO HPET withing the ARB_DIS part of C3 will hang the hardware. The fix is to simply move the timer access outside the ARB_DIS region. This is a no-op on modern hardware because ARB_DIS is no longer used. http://bugzilla.kernel.org/show_bug.cgi?id=13087 Signed-off-by: Len Brown Acked-by: Venkatesh Pallipadi --- drivers/acpi/processor_idle.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 6fe1214..ea23c64 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -955,6 +955,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, */ acpi_state_timer_broadcast(pr, cx, 1); + kt1 = ktime_get_real(); /* * disable bus master * bm_check implies we need ARB_DIS @@ -976,10 +977,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, ACPI_FLUSH_CPU_CACHE(); } - kt1 = ktime_get_real(); acpi_idle_do_entry(cx); - kt2 = ktime_get_real(); - idle_time = ktime_to_us(ktime_sub(kt2, kt1)); /* Re-enable bus master arbitration */ if (pr->flags.bm_check && pr->flags.bm_control) { @@ -988,6 +986,8 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, c3_cpu_count--; spin_unlock(&c3_lock); } + kt2 = ktime_get_real(); + idle_time = ktime_to_us(ktime_sub(kt2, kt1)); #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86) /* TSC could halt in idle, so notify users */