diff options
author | 2011-10-10 20:39:20 +0000 | |
---|---|---|
committer | 2011-10-10 20:39:20 +0000 | |
commit | cf7267713d9ee527c76de0662a31a294ba0fb723 (patch) | |
tree | b59d6cda8f9d64baf1878e7c5ddeda60604a9222 | |
parent | Extend pci_probe_device_hook() on sgi xbridge(4) to return either the straight (diff) | |
download | wireguard-openbsd-cf7267713d9ee527c76de0662a31a294ba0fb723.tar.xz wireguard-openbsd-cf7267713d9ee527c76de0662a31a294ba0fb723.zip |
Put the drive in standby mode when we're powering down the machine.
tested by dcoppa@, ok krw@, miod@
-rw-r--r-- | sys/scsi/sd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 69347a1128e..b808c659963 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.238 2011/07/18 00:13:16 matthew Exp $ */ +/* $OpenBSD: sd.c,v 1.239 2011/10/10 20:39:20 kettenis Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -68,6 +68,7 @@ #include <sys/conf.h> #include <sys/scsiio.h> #include <sys/dkio.h> +#include <sys/reboot.h> #include <scsi/scsi_all.h> #include <scsi/scsi_disk.h> @@ -1127,6 +1128,9 @@ sd_shutdown(void *arg) */ if ((sc->flags & SDF_DIRTY) != 0) sd_flush(sc, SCSI_AUTOCONF); + if (boothowto & RB_POWERDOWN) + scsi_start(sc->sc_link, SSS_STOP, + SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_AUTOCONF); /* * There should be no outstanding IO at this point, but lets stop |