-/* $OpenBSD: acpi.c,v 1.335 2017/11/29 22:51:01 kettenis Exp $ */
+/* $OpenBSD: acpi.c,v 1.336 2018/02/08 06:02:09 deraadt Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
#include "wd.h"
#include "wsdisplay.h"
+#include "softraid.h"
#ifdef ACPI_DEBUG
int acpi_debug = 16;
size_t rndbuflen = 0;
char *rndbuf = NULL;
int state, s;
+#if NSOFTRAID > 0
+ extern void sr_quiesce(void);
+#endif
switch (sleepmode) {
case ACPI_SLEEP_SUSPEND:
if (config_suspend_all(DVACT_QUIESCE))
goto fail_quiesce;
+#if NSOFTRAID > 0
+ sr_quiesce();
+#endif
bufq_quiesce();
#ifdef MULTIPROCESSOR
-/* $OpenBSD: softraid.c,v 1.390 2018/02/07 06:16:08 krw Exp $ */
+/* $OpenBSD: softraid.c,v 1.391 2018/02/08 06:02:09 deraadt Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
EWOULDBLOCK)
break;
+ if (dying == -1) {
+ sd->sd_ready = 1;
+ splx(s);
+ return;
+ }
+
#ifndef SMALL_KERNEL
sr_sensors_delete(sd);
#endif /* SMALL_KERNEL */
return (s);
}
+void
+sr_quiesce(void)
+{
+ struct sr_softc *sc = softraid0;
+ struct sr_discipline *sd, *nsd;
+
+ /* Shutdown disciplines in reverse attach order. */
+ TAILQ_FOREACH_REVERSE_SAFE(sd, &sc->sc_dis_list,
+ sr_discipline_list, sd_link, nsd)
+ sr_discipline_shutdown(sd, 1, -1);
+}
+
void
sr_shutdown(int dying)
{