From patchwork Tue May 18 21:39:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venkatesh Pallipadi X-Patchwork-Id: 100633 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4ILdX24018843 for ; Tue, 18 May 2010 21:39:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757298Ab0ERVjc (ORCPT ); Tue, 18 May 2010 17:39:32 -0400 Received: from smtp-out.google.com ([74.125.121.35]:4070 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754807Ab0ERVjb (ORCPT ); Tue, 18 May 2010 17:39:31 -0400 Received: from kpbe19.cbf.corp.google.com (kpbe19.cbf.corp.google.com [172.25.105.83]) by smtp-out.google.com with ESMTP id o4ILdSaE006318 for ; Tue, 18 May 2010 14:39:29 -0700 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1274218770; bh=Ghc2GO05D9nbLhlics6pxYyzRl8=; h=From:To:Cc:Subject:Date:Message-Id; b=McNRkHYvdOS4pgBhQSVlAjlzD0MTr5eXVsSqy1poxMmrrR72AB5NwmYqvAHnGzJCJ i4bnB8KkuUC6tMPjH6YEQ== DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=from:to:cc:subject:date:message-id:x-mailer:x-system-of-record; b=mWKD7xu2JltTdy41d/3aVd5kVQbL5/FiEizHIqrN+PG295xIxugvBZYvdz8WXjSNg 7lRB4BSp2cvQBLHVYmVRQ== Received: from pzk12 (pzk12.prod.google.com [10.243.19.140]) by kpbe19.cbf.corp.google.com with ESMTP id o4ILdRAJ028538 for ; Tue, 18 May 2010 14:39:27 -0700 Received: by pzk12 with SMTP id 12so4106253pzk.9 for ; Tue, 18 May 2010 14:39:27 -0700 (PDT) Received: by 10.115.132.31 with SMTP id j31mr6537776wan.114.1274218767123; Tue, 18 May 2010 14:39:27 -0700 (PDT) Received: from localhost.localdomain (tippy.mtv.corp.google.com [172.22.64.214]) by mx.google.com with ESMTPS id b6sm61920282wam.21.2010.05.18.14.39.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 18 May 2010 14:39:26 -0700 (PDT) From: Venkatesh Pallipadi To: Len Brown Cc: ACPI list , Shaohua Li , Venkatesh Pallipadi Subject: [PATCH] acpi: Don't let acpi_pad needlessly mark TSC unstable Date: Tue, 18 May 2010 14:39:16 -0700 Message-Id: <1274218756-31306-1-git-send-email-venki@google.com> X-Mailer: git-send-email 1.7.0.1 X-System-Of-Record: true Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 18 May 2010 21:39:33 +0000 (UTC) diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c index 19dacfd..8ca490b 100644 --- a/drivers/acpi/acpi_pad.c +++ b/drivers/acpi/acpi_pad.c @@ -43,6 +43,10 @@ static DEFINE_MUTEX(isolated_cpus_lock); #define CPUID5_ECX_EXTENSIONS_SUPPORTED (0x1) #define CPUID5_ECX_INTERRUPT_BREAK (0x2) static unsigned long power_saving_mwait_eax; + +static unsigned char tsc_detected_unstable; +static unsigned char tsc_marked_unstable; + static void power_saving_mwait_init(void) { unsigned int eax, ebx, ecx, edx; @@ -87,8 +91,8 @@ static void power_saving_mwait_init(void) /*FALL THROUGH*/ default: - /* TSC could halt in idle, so notify users */ - mark_tsc_unstable("TSC halts in idle"); + /* TSC could halt in idle */ + tsc_detected_unstable = 1; } #endif } @@ -178,6 +182,11 @@ static int power_saving_thread(void *data) expire_time = jiffies + HZ * (100 - idle_pct) / 100; while (!need_resched()) { + if (tsc_detected_unstable && !tsc_marked_unstable) { + /* TSC could halt in idle, so notify users */ + mark_tsc_unstable("TSC halts in idle"); + tsc_marked_unstable = 1; + } local_irq_disable(); cpu = smp_processor_id(); clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER,