summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2011-10-10 20:39:21 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2011-10-10 20:39:21 +0000
commit6039a8200aff868348d3e04687fa872a89b4bc41 (patch)
tree13c43ef8a116445cd2f9b57a9a938822f4dc6bf2
parent7365eaa981a257d0f603424ed53e4cd189ee7ecd (diff)
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.c6
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