From 2d1debfdfc1688f09061ad256b4a76da20cf95cd Mon Sep 17 00:00:00 2001 From: deraadt Date: Tue, 20 Jul 2010 12:23:00 +0000 Subject: [PATCH] also use bufq_quiesce() when suspending, and bufq_restart() when resuming, which will result in more stable filesystems during suspend ok kettenis --- sys/arch/i386/i386/apm.c | 8 +++++++- sys/arch/zaurus/dev/zaurus_apm.c | 6 +++++- 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 #include #include +#include #include #include /* 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 @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -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); } -- 2.20.1