From: Thomas Gleixner <tglx@linutronix.de>
To: Fab Stz <fabstz-it@yahoo.fr>, John Stultz <jstultz@google.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
Anna-Maria Behnsen <anna-maria@linutronix.de>,
Frederic Weisbecker <frederic@kernel.org>,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
Jacob Pan <jacob.jun.pan@linux.intel.com>,
Len Brown <lenb@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>
Subject: [PATCH] intel_idle: Handle older CPUs, which stop the TSC in deeper C states, correctly
Date: Tue, 25 Feb 2025 23:37:08 +0100 [thread overview]
Message-ID: <87bjupfy7f.ffs@tglx> (raw)
In-Reply-To: <87eczlg6ls.ffs@tglx>
The Intel idle driver is preferred over the ACPI processor idle driver,
but fails to implement the work around for Core2 generation CPUs, where
the TSC stops in C2 and deeper C-states. This causes stalls and boot
delays, when the clocksource watchdog does not catch the unstable TSC
before the CPU goes deep idle for the first time.
The ACPI driver marks the TSC unstable when it detects that the CPU
supports C2 or deeper and the CPU does not have a non-stop TSC.
Add the equivivalent work around to the Intel idle driver to cure that.
Fixes: 18734958e9bf ("intel_idle: Use ACPI _CST for processor models without C-state tables")
Reported-by: Fab Stz <fabstz-it@yahoo.fr>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Fab Stz <fabstz-it@yahoo.fr>
Cc: stable@vger.kernel.org
Closes: https://lore.kernel.org/all/10cf96aa-1276-4bd4-8966-c890377030c3@yahoo.fr
---
drivers/idle/intel_idle.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -56,6 +56,7 @@
#include <asm/intel-family.h>
#include <asm/mwait.h>
#include <asm/spec-ctrl.h>
+#include <asm/tsc.h>
#include <asm/fpu/api.h>
#define INTEL_IDLE_VERSION "0.5.1"
@@ -1799,6 +1800,9 @@ static void __init intel_idle_init_cstat
if (intel_idle_state_needs_timer_stop(state))
state->flags |= CPUIDLE_FLAG_TIMER_STOP;
+ if (cx->type > ACPI_STATE_C1 && !boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
+ mark_tsc_unstable("TSC halts in idle");
+
state->enter = intel_idle;
state->enter_s2idle = intel_idle_s2idle;
}
next prev parent reply other threads:[~2025-02-25 22:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <10cf96aa-1276-4bd4-8966-c890377030c3.ref@yahoo.fr>
[not found] ` <10cf96aa-1276-4bd4-8966-c890377030c3@yahoo.fr>
[not found] ` <22539099.EfDdHjke4D@debian>
[not found] ` <CANDhNCqdpbi=r81NyXVWBbB5POj5nmrc7qo3r2bi1yYqYBgiAg@mail.gmail.com>
[not found] ` <CANDhNCqFi1adk_MdejQC1bod5STHPDjaSB9imSGpRtJt3TbW1Q@mail.gmail.com>
[not found] ` <c1d1b79c-bb2e-4a69-888d-a3301bcbfeb2@yahoo.fr>
[not found] ` <CANDhNCreiCQUKccmW1wBtvVzQrfB=xC0GFRO65SHG-+Wfu1wtA@mail.gmail.com>
[not found] ` <b9b58a9e-eb56-4acd-b854-0b5ccb8e6759@yahoo.fr>
[not found] ` <87plkoau8w.ffs@tglx>
[not found] ` <15f4f44d-6f73-4031-a7dc-d2105672bc81@yahoo.fr>
2025-02-24 8:13 ` [REGRESSION] ? system is stuck in clocksource, >60s delay at boot time without tsc=unstable Thomas Gleixner
2025-02-25 8:11 ` Fab Stz
2025-02-25 19:35 ` Thomas Gleixner
2025-02-25 22:37 ` Thomas Gleixner [this message]
2025-02-26 10:24 ` [PATCH] intel_idle: Handle older CPUs, which stop the TSC in deeper C states, correctly Rafael J. Wysocki
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=87bjupfy7f.ffs@tglx \
--to=tglx@linutronix.de \
--cc=anna-maria@linutronix.de \
--cc=daniel.lezcano@linaro.org \
--cc=fabstz-it@yahoo.fr \
--cc=frederic@kernel.org \
--cc=jacob.jun.pan@linux.intel.com \
--cc=jstultz@google.com \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).