diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2014-09-18 18:47:30 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2014-09-18 18:47:30 +0000 |
commit | 231d13d4d0bf14d55fe755ad590ef613f8d1ea78 (patch) | |
tree | b199565aa4b4c6848a90fd729a5cef661dac032d /sys/scsi/sd.c | |
parent | 24539570c81ff58d8daf3f879641a31f086553c0 (diff) |
Some disks, such as the Seagate Cheetah 73LP FC with Sun firmware
(ST373405FSUN72G) respond to a START STOP UNIT command that spins down the
disk with a "Logical Unit Not Ready, Initialization Command Required".
Besides causing some dmesg spam, our sd(4) driver responds to such a response
by spinning the disk back up. Prevent this from happening by respecting
the SCSI_IGNORE_NOT_READY flag and using that flag when spinning down the
disk.
ok miod@
Diffstat (limited to 'sys/scsi/sd.c')
-rw-r--r-- | sys/scsi/sd.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index d5839c43ff6..68053ec2d26 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.256 2014/09/14 14:17:26 jsg Exp $ */ +/* $OpenBSD: sd.c,v 1.257 2014/09/18 18:47:29 kettenis Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -292,7 +292,8 @@ sdactivate(struct device *self, int act) sd_flush(sc, SCSI_AUTOCONF); if (boothowto & RB_POWERDOWN) scsi_start(sc->sc_link, SSS_STOP, - SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_AUTOCONF); + SCSI_IGNORE_ILLEGAL_REQUEST | + SCSI_IGNORE_NOT_READY | SCSI_AUTOCONF); break; case DVACT_RESUME: scsi_start(sc->sc_link, SSS_START, @@ -1137,6 +1138,9 @@ sd_interpret_sense(struct scsi_xfer *xs) (sense->extra_len < 6)) return (scsi_interpret_sense(xs)); + if ((xs->flags & SCSI_IGNORE_NOT_READY) != 0) + return (0); + switch (ASC_ASCQ(sense)) { case SENSE_NOT_READY_BECOMING_READY: SC_DEBUG(sc_link, SDEV_DB1, ("becoming ready.\n")); |