Skip to content

Commit ef3bc90

Browse files
KAGA-KOKOgregkh
authored andcommitted
intel_idle: Handle older CPUs, which stop the TSC in deeper C states, correctly
commit c157d351460bcf202970e97e611cb6b54a3dd4a4 upstream. 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: 1873495 ("intel_idle: Use ACPI _CST for processor models without C-state tables") Reported-by: Fab Stz <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Fab Stz <[email protected]> Cc: All applicable <[email protected]> Closes: https://lore.kernel.org/all/[email protected] Link: https://patch.msgid.link/87bjupfy7f.ffs@tglx Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b6eac41 commit ef3bc90

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/idle/intel_idle.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
#include <asm/nospec-branch.h>
5757
#include <asm/mwait.h>
5858
#include <asm/msr.h>
59+
#include <asm/tsc.h>
5960
#include <asm/fpu/api.h>
6061

6162
#define INTEL_IDLE_VERSION "0.5.1"
@@ -1583,6 +1584,9 @@ static void __init intel_idle_init_cstates_acpi(struct cpuidle_driver *drv)
15831584
if (intel_idle_state_needs_timer_stop(state))
15841585
state->flags |= CPUIDLE_FLAG_TIMER_STOP;
15851586

1587+
if (cx->type > ACPI_STATE_C1 && !boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
1588+
mark_tsc_unstable("TSC halts in idle");
1589+
15861590
state->enter = intel_idle;
15871591
state->enter_s2idle = intel_idle_s2idle;
15881592
}

0 commit comments

Comments
 (0)