Index: sys/kern/kern_tc.c =================================================================== --- sys/kern/kern_tc.c (revision 223446) +++ sys/kern/kern_tc.c (working copy) @@ -492,6 +492,12 @@ tc_windup(void) /* Now is a good time to change timecounters. */ if (th->th_counter != timecounter) { +#if !defined(__arm__) && !defined(__ia64__) + if ((timecounter->tc_flags & TC_FLAGS_C3STOP) != 0) + cpu_disable_deep_sleep++; + if ((th->th_counter->tc_flags & TC_FLAGS_C3STOP) != 0) + cpu_disable_deep_sleep--; +#endif th->th_counter = timecounter; th->th_offset_count = ncount; tc_min_ticktock_freq = max(1, timecounter->tc_frequency / Index: sys/sparc64/sparc64/counter.c =================================================================== --- sys/sparc64/sparc64/counter.c (revision 223446) +++ sys/sparc64/sparc64/counter.c (working copy) @@ -98,6 +98,7 @@ sparc64_counter_init(const char *name, bus_space_t tc->tc_name = strdup(name, M_DEVBUF); tc->tc_priv = sc; tc->tc_quality = COUNTER_QUALITY; + tc->tc_flags = 0; tc_init(tc); } Index: sys/sys/timetc.h =================================================================== --- sys/sys/timetc.h (revision 223446) +++ sys/sys/timetc.h (working copy) @@ -57,6 +57,8 @@ struct timecounter { * another timecounter higher means better. Negative * means "only use at explicit request". */ + u_int tc_flags; +#define TC_FLAGS_C3STOP 1 /* Timer dies in C3. */ void *tc_priv; /* Pointer to the timecounter's private parts. */ Index: sys/x86/x86/tsc.c =================================================================== --- sys/x86/x86/tsc.c (revision 223446) +++ sys/x86/x86/tsc.c (working copy) @@ -452,6 +452,7 @@ init_TSC_tc(void) if (cpu_can_deep_sleep && cpu_vendor_id == CPU_VENDOR_INTEL && (amd_pminfo & AMDPM_TSC_INVARIANT) == 0) { tsc_timecounter.tc_quality = -1000; + tsc_timecounter.tc_flags |= TC_FLAGS_C3STOP; if (bootverbose) printf("TSC timecounter disabled: C3 enabled.\n"); goto init;