diff options
author | cth <none@none> | 2006-07-19 19:16:10 -0700 |
---|---|---|
committer | cth <none@none> | 2006-07-19 19:16:10 -0700 |
commit | 646e55b6807cdf761fecd1e4095d73116cdefdb5 (patch) | |
tree | 8af602e0b1562af1fbd29993c1c34f3838ba19bc | |
parent | c60b2222554c03f81f52c4593a0a795d15f5be87 (diff) | |
download | illumos-joyent-646e55b6807cdf761fecd1e4095d73116cdefdb5.tar.gz |
6234740 gettimeofday() glitches after DR
-rw-r--r-- | usr/src/uts/sun4u/cpu/common_asm.s | 3 | ||||
-rw-r--r-- | usr/src/uts/sun4u/ngdr/io/dr_quiesce.c | 14 | ||||
-rw-r--r-- | usr/src/uts/sun4u/serengeti/io/sbdp_quiesce.c | 9 | ||||
-rw-r--r-- | usr/src/uts/sun4u/sunfire/io/sysctrl_quiesce.c | 10 | ||||
-rw-r--r-- | usr/src/uts/sun4v/cpu/common_asm.s | 3 |
5 files changed, 31 insertions, 8 deletions
diff --git a/usr/src/uts/sun4u/cpu/common_asm.s b/usr/src/uts/sun4u/cpu/common_asm.s index 3b714a5a10..daf3f9d3c3 100644 --- a/usr/src/uts/sun4u/cpu/common_asm.s +++ b/usr/src/uts/sun4u/cpu/common_asm.s @@ -544,7 +544,7 @@ panic_hres_tick(void) brz,pt adj, 3f; /* no adjustments, it's easy */ \ add hrestnsec, nslt, hrestnsec; /* hrest.tv_nsec += nslt */ \ brlz,pn adj, 2f; /* if hrestime_adj negative */ \ - srl nslt, ADJ_SHIFT, nslt; /* delay: nslt >>= 4 */ \ + srlx nslt, ADJ_SHIFT, nslt; /* delay: nslt >>= 4 */ \ subcc adj, nslt, %g0; /* hrestime_adj - nslt/16 */ \ movg %xcc, nslt, adj; /* adj by min(adj, nslt/16) */ \ ba 3f; /* go convert to sec/nsec */ \ @@ -558,6 +558,7 @@ panic_hres_tick(void) nop; /* delay: do nothing :( */ \ add hrestsec, 1, hrestsec; /* hrest.tv_sec++; */ \ sub hrestnsec, nano, hrestnsec; /* hrest.tv_nsec -= NANOSEC; */ \ + ba,a 3b; /* check >= billion again */ \ 4: ENTRY_NP(gethrestime) diff --git a/usr/src/uts/sun4u/ngdr/io/dr_quiesce.c b/usr/src/uts/sun4u/ngdr/io/dr_quiesce.c index 5fe1d75be6..fb61524dfb 100644 --- a/usr/src/uts/sun4u/ngdr/io/dr_quiesce.c +++ b/usr/src/uts/sun4u/ngdr/io/dr_quiesce.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -728,6 +727,14 @@ dr_resume(dr_sr_handle_t *srh) ASSERT(MUTEX_HELD(&cpu_lock)); + /* + * Prevent false alarm in tod_validate() due to tod + * value change between suspend and resume + */ + mutex_enter(&tod_lock); + tod_fault_reset(); + mutex_exit(&tod_lock); + dr_enable_intr(); /* enable intr & clock */ start_cpus(); @@ -747,7 +754,6 @@ dr_resume(dr_sr_handle_t *srh) * If we suspended hw watchdog at suspend, * re-enable it now. */ - if (srh->sr_flags & (SR_FLAG_WATCHDOG)) { mutex_enter(&tod_lock); tod_ops.tod_set_watchdog_timer( diff --git a/usr/src/uts/sun4u/serengeti/io/sbdp_quiesce.c b/usr/src/uts/sun4u/serengeti/io/sbdp_quiesce.c index 95c602561c..ab078974e3 100644 --- a/usr/src/uts/sun4u/serengeti/io/sbdp_quiesce.c +++ b/usr/src/uts/sun4u/serengeti/io/sbdp_quiesce.c @@ -682,6 +682,14 @@ sbdp_resume(sbdp_sr_handle_t *srh) ASSERT(MUTEX_HELD(&cpu_lock)); + /* + * Prevent false alarm in tod_validate() due to tod + * value change between suspend and resume + */ + mutex_enter(&tod_lock); + tod_fault_reset(); + mutex_exit(&tod_lock); + sbdp_enable_intr(); /* enable intr & clock */ /* @@ -695,7 +703,6 @@ sbdp_resume(sbdp_sr_handle_t *srh) * If we suspended hw watchdog at suspend, * re-enable it now. */ - if (SR_CHECK_FLAG(srh, SR_FLAG_WATCHDOG)) { mutex_enter(&tod_lock); tod_ops.tod_set_watchdog_timer( diff --git a/usr/src/uts/sun4u/sunfire/io/sysctrl_quiesce.c b/usr/src/uts/sun4u/sunfire/io/sysctrl_quiesce.c index ea861a35a2..93d229fb3e 100644 --- a/usr/src/uts/sun4u/sunfire/io/sysctrl_quiesce.c +++ b/usr/src/uts/sun4u/sunfire/io/sysctrl_quiesce.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -564,6 +564,14 @@ sysctrl_resume(sysc_cfga_pkt_t *pkt) #ifndef Bug_4154263 DEBUGP(errp("release cpus...")); #endif + /* + * Prevent false alarm in tod_validate() due to tod + * value change between suspend and resume + */ + mutex_enter(&tod_lock); + tod_fault_reset(); + mutex_exit(&tod_lock); + sysctrl_release_cpus(); DEBUGP(errp("cpus resumed...\n")); diff --git a/usr/src/uts/sun4v/cpu/common_asm.s b/usr/src/uts/sun4v/cpu/common_asm.s index 2bfd42aca5..e70c5c258d 100644 --- a/usr/src/uts/sun4v/cpu/common_asm.s +++ b/usr/src/uts/sun4v/cpu/common_asm.s @@ -370,7 +370,7 @@ panic_hres_tick(void) brz,pt adj, 3f; /* no adjustments, it's easy */ \ add hrestnsec, nslt, hrestnsec; /* hrest.tv_nsec += nslt */ \ brlz,pn adj, 2f; /* if hrestime_adj negative */ \ - srl nslt, ADJ_SHIFT, nslt; /* delay: nslt >>= 4 */ \ + srlx nslt, ADJ_SHIFT, nslt; /* delay: nslt >>= 4 */ \ subcc adj, nslt, %g0; /* hrestime_adj - nslt/16 */ \ movg %xcc, nslt, adj; /* adj by min(adj, nslt/16) */ \ ba 3f; /* go convert to sec/nsec */ \ @@ -384,6 +384,7 @@ panic_hres_tick(void) nop; /* delay: do nothing :( */ \ add hrestsec, 1, hrestsec; /* hrest.tv_sec++; */ \ sub hrestnsec, nano, hrestnsec; /* hrest.tv_nsec -= NANOSEC; */ \ + ba,a 3b; /* check >= billion again */ \ 4: ENTRY_NP(gethrestime) |