diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-03-31 12:11:43 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-03-31 12:11:43 +0000 |
commit | fae73afbd20dc3cd44ea664026235729f431510f (patch) | |
tree | 7a335eda983e3c7d0753973364492c020866ec06 /sys/arch | |
parent | 0be8523562885f1ddbd3cb2a0f5a878d8dd8951e (diff) |
Change the order of operations during a suspend/resume cycle and
call bufq_quiesce() after executing the DVACT_QUIESCE handlers.
This should be safe since no disk nor controller drivers have such
handler but it will allow us to detach sd(4) devices attached to a
USB bus.
Another benefit pointed out by kettenis@ is that drivers that need
to read a firmware from the disk should be able to do it at resume
time in a DVACT_WAKEUP handler.
ok kettenis@, deraadt@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/i386/i386/apm.c | 4 | ||||
-rw-r--r-- | sys/arch/loongson/dev/apm.c | 4 | ||||
-rw-r--r-- | sys/arch/zaurus/dev/zaurus_apm.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/sys/arch/i386/i386/apm.c b/sys/arch/i386/i386/apm.c index 1a350ec57bb..442e0f23edd 100644 --- a/sys/arch/i386/i386/apm.c +++ b/sys/arch/i386/i386/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.104 2014/03/29 18:09:29 guenther Exp $ */ +/* $OpenBSD: apm.c,v 1.105 2014/03/31 12:11:42 mpi Exp $ */ /*- * Copyright (c) 1998-2001 Michael Shalayeff. All rights reserved. @@ -249,8 +249,8 @@ apm_suspend(int state) #if NWSDISPLAY > 0 wsdisplay_suspend(); #endif /* NWSDISPLAY > 0 */ - bufq_quiesce(); config_suspend(mainbus, DVACT_QUIESCE); + bufq_quiesce(); s = splhigh(); disable_intr(); diff --git a/sys/arch/loongson/dev/apm.c b/sys/arch/loongson/dev/apm.c index 7ffc588d9ce..3ec9c4d9c5c 100644 --- a/sys/arch/loongson/dev/apm.c +++ b/sys/arch/loongson/dev/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.18 2014/03/13 03:52:55 dlg Exp $ */ +/* $OpenBSD: apm.c,v 1.19 2014/03/31 12:11:42 mpi Exp $ */ /*- * Copyright (c) 2001 Alexander Guy. All rights reserved. @@ -370,8 +370,8 @@ apm_suspend(int state) resettodr(); - bufq_quiesce(); config_suspend(mainbus, DVACT_QUIESCE); + bufq_quiesce(); s = splhigh(); (void)disableintr(); diff --git a/sys/arch/zaurus/dev/zaurus_apm.c b/sys/arch/zaurus/dev/zaurus_apm.c index 942f4bca837..68e957d40e2 100644 --- a/sys/arch/zaurus/dev/zaurus_apm.c +++ b/sys/arch/zaurus/dev/zaurus_apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zaurus_apm.c,v 1.25 2014/03/13 03:52:56 dlg Exp $ */ +/* $OpenBSD: zaurus_apm.c,v 1.26 2014/03/31 12:11:42 mpi Exp $ */ /* * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de> @@ -569,8 +569,8 @@ zapm_suspend(struct pxa2x0_apm_softc *pxa_sc) { struct zapm_softc *sc = (struct zapm_softc *)pxa_sc; - bufq_quiesce(); config_suspend(device_mainbus(), DVACT_QUIESCE); + bufq_quiesce(); /* Poll in suspended mode and forget the discharge timeout. */ sc->sc_suspended = 1; |