diff options
| author | Roger Pau Monné <royger@FreeBSD.org> | 2016-05-02 18:23:48 +0000 |
|---|---|---|
| committer | Roger Pau Monné <royger@FreeBSD.org> | 2016-05-02 18:23:48 +0000 |
| commit | 6e2a4a5f48b3358906180af9ce187ef1cef435b7 (patch) | |
| tree | d8cd350403c61c2b8cd3117940cadf58a744bc6f /sys/dev/xen/control | |
| parent | bc153c692ff962bda50532211fdc0086a58e6c52 (diff) | |
Notes
Diffstat (limited to 'sys/dev/xen/control')
| -rw-r--r-- | sys/dev/xen/control/control.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/dev/xen/control/control.c b/sys/dev/xen/control/control.c index c7bd8c27b295..5e00bebfeb57 100644 --- a/sys/dev/xen/control/control.c +++ b/sys/dev/xen/control/control.c @@ -122,6 +122,7 @@ __FBSDID("$FreeBSD$"); #include <sys/sched.h> #include <sys/smp.h> #include <sys/eventhandler.h> +#include <sys/timetc.h> #include <geom/geom.h> @@ -197,6 +198,8 @@ xctrl_suspend() #endif int suspend_cancelled; + EVENTHANDLER_INVOKE(power_suspend_early); + stop_all_proc(); EVENTHANDLER_INVOKE(power_suspend); if (smp_started) { @@ -222,7 +225,6 @@ xctrl_suspend() printf("%s: device_suspend failed\n", __func__); return; } - mtx_unlock(&Giant); #ifdef SMP CPU_ZERO(&cpu_suspend_map); /* silence gcc */ @@ -273,16 +275,24 @@ xctrl_suspend() * FreeBSD really needs to add DEVICE_SUSPEND_CANCEL or * similar. */ - mtx_lock(&Giant); DEVICE_RESUME(root_bus); mtx_unlock(&Giant); + /* + * Warm up timecounter again and reset system clock. + */ + timecounter->tc_get_timecount(timecounter); + timecounter->tc_get_timecount(timecounter); + inittodr(time_second); + if (smp_started) { thread_lock(curthread); sched_unbind(curthread); thread_unlock(curthread); } + resume_all_proc(); + EVENTHANDLER_INVOKE(power_resume); if (bootverbose) |
