mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Janne Kulmala <janne.t.kulmala@tut.fi>,
	Frans Pop <elendil@planet.nl>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>, Ingo Molnar <mingo@elte.hu>,
	johnstul@us.ibm.com
Subject: [PATCH] ACPI: idle: fix init-time TSC check regression
Date: Thu, 14 May 2009 17:55:16 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.2.00.0905141750100.24833@localhost.localdomain> (raw)
In-Reply-To: <alpine.LFD.2.00.0905142217340.3561@localhost.localdomain>

From: Len Brown <len.brown@intel.com>

A previous 2.6.30 patch, a71e4917dc0ebbcb5a0ecb7ca3486643c1c9a6e2,
(ACPI: idle: mark_tsc_unstable() at init-time, not run-time)
erroneously disabled the TSC on systems that did not actually
have valid deep C-states.

Move the check after the deep-C-states are validated,
via new helper, tsc_check_state(), hich replaces tsc_halts_in_c().

Signed-off-by: Len Brown <len.brown@intel.com>
Acked-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
---
Thomas,
I decided to use a tsc-specific helper
rather than piggyback on acpi_timer_check_state(),
since that is not general, but rather LAPIC timer specific.
(and I'll re-name that to reflect its specific function
 in a cosmetic follow-up patch)

 drivers/acpi/processor_idle.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index f7ca8c5..421cc5c 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -216,7 +216,7 @@ int acpi_processor_resume(struct acpi_device * device)
 }
 
 #if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
-static int tsc_halts_in_c(int state)
+static void tsc_check_state(int state)
 {
 	switch (boot_cpu_data.x86_vendor) {
 	case X86_VENDOR_AMD:
@@ -226,13 +226,17 @@ static int tsc_halts_in_c(int state)
 		 * C/P/S0/S1 states when this bit is set.
 		 */
 		if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
-			return 0;
+			return;
 
 		/*FALL THROUGH*/
 	default:
-		return state > ACPI_STATE_C1;
+		/* TSC could halt in idle, so notify users */
+		if (state > ACPI_STATE_C1)
+			mark_tsc_unstable("TSC halts in idle");
 	}
 }
+#else
+static void tsc_check_state(int state) { return; }
 #endif
 
 static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
@@ -581,11 +585,6 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
 	for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
 		struct acpi_processor_cx *cx = &pr->power.states[i];
 
-#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
-		/* TSC could halt in idle, so notify users */
-		if (tsc_halts_in_c(cx->type))
-			mark_tsc_unstable("TSC halts in idle");;
-#endif
 		switch (cx->type) {
 		case ACPI_STATE_C1:
 			cx->valid = 1;
@@ -603,6 +602,8 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
 				acpi_timer_check_state(i, pr, cx);
 			break;
 		}
+		if (cx->valid)
+			tsc_check_state(cx->type);
 
 		if (cx->valid)
 			working++;
-- 
1.6.3.1.9.g95405b


  reply	other threads:[~2009-05-14 22:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-08  4:14 regression in TSC unstable? Steven Rostedt
2009-05-08  5:21 ` Len Brown
2009-05-08 12:07   ` Ingo Molnar
2009-05-11  0:26 ` Regression in TSC unstable -- confirmed Frans Pop
2009-05-11 14:22   ` [PATCH] ACPI: do not mark TSC unstable for invalid C-states Thomas Gleixner
2009-05-11 15:00     ` Steven Rostedt
2009-05-11 15:03     ` Frans Pop
2009-05-11 16:43     ` Janne Kulmala
2009-05-14 19:46       ` Len Brown
2009-05-14 20:09         ` Len Brown
2009-05-14 20:19           ` Thomas Gleixner
2009-05-14 21:55             ` Len Brown [this message]
2009-05-14 22:27               ` [PATCH] ACPI: idle: fix init-time TSC check regression Thomas Gleixner
2009-05-15  3:36                 ` Len Brown
2009-05-14 22:31               ` Frans Pop
2009-05-15  5:40               ` [PATCH] ACPI: Idle C-states disabled by max_cstate should not disable the TSC Len Brown
2009-05-15  6:18                 ` [PATCH] ACPI: idle: rename lapic timer workaround routines Len Brown
2009-05-15  8:28                   ` Thomas Gleixner
2009-05-15  8:27                 ` [PATCH] ACPI: Idle C-states disabled by max_cstate should not disable the TSC Thomas Gleixner
2009-05-15 10:57               ` [PATCH] ACPI: idle: fix init-time TSC check regression Frans Pop

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.00.0905141750100.24833@localhost.localdomain \
    --to=lenb@kernel.org \
    --cc=elendil@planet.nl \
    --cc=janne.t.kulmala@tut.fi \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®