summaryrefslogtreecommitdiffstats
path: root/sys/dev/vt
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2015-01-27 17:33:18 +0000
committeravg <avg@FreeBSD.org>2015-01-27 17:33:18 +0000
commit2a1f5c1f69f4493ab92c4ae617cf2ea4ec95f904 (patch)
treea3c6b5ecbcaa2b0c648bfbaa993539f42ebe4ab6 /sys/dev/vt
parentfeecf521e9468e3ccff20fcbe45d9a810f0563cf (diff)
downloadFreeBSD-src-2a1f5c1f69f4493ab92c4ae617cf2ea4ec95f904.zip
FreeBSD-src-2a1f5c1f69f4493ab92c4ae617cf2ea4ec95f904.tar.gz
hook userland threads suspend + resume into acpi suspend code
Also, split power_suspend into power_suspend and power_suspend_early. power_suspend_early is called before the userland is frozen. power_suspend is called after the userland is frozen. Currently only VT switching is hooked to power_suspend_early. This is needed because switching away from X server requires its cooperation, so obviously X server must not be frozen when that happens. Freezing userland during ACPI suspend is useful because not all drivers correctly handle suspension concurrent with other activity. This is especially applicable to drivers ported from other operating systems that suspend all software activity between placing drivers and hardware into suspended state. In particular drm2/radeon (radeonkms) depends on the described procedure. The driver does not have any internal synchronization between suspension activities and processing of userland requests. Many thanks to kib for the code that allows to freeze and thaw all userland threads. Note that ideally we also need to park / inhibit (non-special) kernel threads as well to ensure that they do not call into drivers. MFC after: 17 days
Diffstat (limited to 'sys/dev/vt')
-rw-r--r--sys/dev/vt/vt_core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c
index d700730..47b3c8a 100644
--- a/sys/dev/vt/vt_core.c
+++ b/sys/dev/vt/vt_core.c
@@ -2556,8 +2556,8 @@ vt_upgrade(struct vt_device *vd)
vd->vd_timer_armed = 1;
/* Register suspend/resume handlers. */
- EVENTHANDLER_REGISTER(power_suspend, vt_suspend_handler, vd,
- EVENTHANDLER_PRI_ANY);
+ EVENTHANDLER_REGISTER(power_suspend_early, vt_suspend_handler,
+ vd, EVENTHANDLER_PRI_ANY);
EVENTHANDLER_REGISTER(power_resume, vt_resume_handler, vd,
EVENTHANDLER_PRI_ANY);
}
OpenPOWER on IntegriCloud