summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_clocksource.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2015-04-02 01:02:42 +0000
committerjhb <jhb@FreeBSD.org>2015-04-02 01:02:42 +0000
commitb09b758bf25e41249b9253a3a796713405f28b4d (patch)
tree7694f537b30d0bb29bc4821549a8b28e4d2fb4b4 /sys/kern/kern_clocksource.c
parent5fdf8ec7775f40bbf293206a9670387f9b26b1e2 (diff)
downloadFreeBSD-src-b09b758bf25e41249b9253a3a796713405f28b4d.zip
FreeBSD-src-b09b758bf25e41249b9253a3a796713405f28b4d.tar.gz
MFC 276724:
On some Intel CPUs with a P-state but not C-state invariant TSC the TSC may also halt in C2 and not just C3 (it seems that in some cases the BIOS advertises its C3 state as a C2 state in _CST). Just play it safe and disable both C2 and C3 states if a user forces the use of the TSC as the timecounter on such CPUs. PR: 192316
Diffstat (limited to 'sys/kern/kern_clocksource.c')
-rw-r--r--sys/kern/kern_clocksource.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/kern/kern_clocksource.c b/sys/kern/kern_clocksource.c
index 739f850..b98c4ed 100644
--- a/sys/kern/kern_clocksource.c
+++ b/sys/kern/kern_clocksource.c
@@ -60,8 +60,9 @@ __FBSDID("$FreeBSD$");
cyclic_clock_func_t cyclic_clock_func = NULL;
#endif
-int cpu_can_deep_sleep = 0; /* C3 state is available. */
-int cpu_disable_deep_sleep = 0; /* Timer dies in C3. */
+int cpu_deepest_sleep = 0; /* Deepest Cx state available. */
+int cpu_disable_c2_sleep = 0; /* Timer dies in C2. */
+int cpu_disable_c3_sleep = 0; /* Timer dies in C3. */
static void setuptimer(void);
static void loadtimer(sbintime_t now, int first);
@@ -630,7 +631,7 @@ cpu_initclocks_bsp(void)
else if (!periodic && (timer->et_flags & ET_FLAGS_ONESHOT) == 0)
periodic = 1;
if (timer->et_flags & ET_FLAGS_C3STOP)
- cpu_disable_deep_sleep++;
+ cpu_disable_c3_sleep++;
/*
* We honor the requested 'hz' value.
@@ -931,9 +932,9 @@ sysctl_kern_eventtimer_timer(SYSCTL_HANDLER_ARGS)
configtimer(0);
et_free(timer);
if (et->et_flags & ET_FLAGS_C3STOP)
- cpu_disable_deep_sleep++;
+ cpu_disable_c3_sleep++;
if (timer->et_flags & ET_FLAGS_C3STOP)
- cpu_disable_deep_sleep--;
+ cpu_disable_c3_sleep--;
periodic = want_periodic;
timer = et;
et_init(timer, timercb, NULL, NULL);
OpenPOWER on IntegriCloud