summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2010-07-20 12:23:03 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2010-07-20 12:23:03 +0000
commit7c54930736fb5d12651e9b204e8afb8123bf074d (patch)
tree8134b6717f7a1b0b0eda30112159c2d4ac669a32
parent6ae6938e07ea5887d5cef37a5c0c2513f7c4504d (diff)
also use bufq_quiesce() when suspending, and bufq_restart() when resuming,
which will result in more stable filesystems during suspend ok kettenis
-rw-r--r--sys/arch/i386/i386/apm.c8
-rw-r--r--sys/arch/zaurus/dev/zaurus_apm.c6
2 files changed, 12 insertions, 2 deletions
diff --git a/sys/arch/i386/i386/apm.c b/sys/arch/i386/i386/apm.c
index 5203799650d..22243f7f573 100644
--- a/sys/arch/i386/i386/apm.c
+++ b/sys/arch/i386/i386/apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apm.c,v 1.86 2010/06/26 23:24:43 guenther Exp $ */
+/* $OpenBSD: apm.c,v 1.87 2010/07/20 12:23:00 deraadt Exp $ */
/*-
* Copyright (c) 1998-2001 Michael Shalayeff. All rights reserved.
@@ -48,6 +48,7 @@
#include <sys/device.h>
#include <sys/fcntl.h>
#include <sys/ioctl.h>
+#include <sys/buf.h>
#include <sys/event.h>
#include <sys/mount.h> /* for vfs_syncwait() proto */
@@ -322,6 +323,8 @@ apm_suspend()
#if NWSDISPLAY > 0
wsdisplay_suspend();
#endif /* NWSDISPLAY > 0 */
+ bufq_quiesce();
+
dopowerhooks(PWR_SUSPEND);
if (cold)
@@ -336,6 +339,8 @@ apm_standby()
#if NWSDISPLAY > 0
wsdisplay_suspend();
#endif /* NWSDISPLAY > 0 */
+ bufq_quiesce();
+
dopowerhooks(PWR_STANDBY);
if (cold)
@@ -365,6 +370,7 @@ apm_resume(struct apm_softc *sc, struct apmregs *regs)
/* restore hw.setperf */
if (cpu_setperf != NULL)
cpu_setperf(perflevel);
+ bufq_restart();
#if NWSDISPLAY > 0
wsdisplay_resume();
#endif /* NWSDISPLAY > 0 */
diff --git a/sys/arch/zaurus/dev/zaurus_apm.c b/sys/arch/zaurus/dev/zaurus_apm.c
index 87997e9f35c..422c53aba4a 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.15 2010/04/21 03:11:30 deraadt Exp $ */
+/* $OpenBSD: zaurus_apm.c,v 1.16 2010/07/20 12:23:02 deraadt Exp $ */
/*
* Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de>
@@ -22,6 +22,7 @@
#include <sys/timeout.h>
#include <sys/conf.h>
#include <sys/proc.h>
+#include <sys/buf.h>
#include <sys/sysctl.h>
#include <arm/xscale/pxa2x0reg.h>
@@ -567,6 +568,8 @@ zapm_suspend(struct pxa2x0_apm_softc *pxa_sc)
{
struct zapm_softc *sc = (struct zapm_softc *)pxa_sc;
+ bufq_quiesce();
+
/* Poll in suspended mode and forget the discharge timeout. */
sc->sc_suspended = 1;
timeout_del(&sc->sc_poll);
@@ -631,6 +634,7 @@ zapm_resume(struct pxa2x0_apm_softc *pxa_sc)
#endif
}
+ bufq_restart();
return (wakeup);
}