summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Rosenfeld <hans.rosenfeld@joyent.com>2018-11-05 10:19:22 +0000
committerHans Rosenfeld <hans.rosenfeld@joyent.com>2018-11-05 11:42:00 +0100
commit9b539c3a538225ff8d6ffa0132e51db9a678401f (patch)
treecb45d584989b2974d35ca3a894b38b5d3077cbe5
parent1169729f845efa9db60803c6cfd33e594a2954f3 (diff)
downloadillumos-joyent-9b539c3a538225ff8d6ffa0132e51db9a678401f.tar.gz
OS-7313 Samsung PM1635a breaks when using power conditions
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Reviewed by: Patrick Mooney <patrick.mooney@joyent.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Approved by: Patrick Mooney <patrick.mooney@joyent.com>
-rw-r--r--usr/src/uts/common/io/scsi/targets/sd.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/usr/src/uts/common/io/scsi/targets/sd.c b/usr/src/uts/common/io/scsi/targets/sd.c
index 550d1afe23..95f0b3b82a 100644
--- a/usr/src/uts/common/io/scsi/targets/sd.c
+++ b/usr/src/uts/common/io/scsi/targets/sd.c
@@ -7109,7 +7109,20 @@ sdpower(dev_info_t *devi, int component, int level)
sd_ssc_assessment(ssc, SD_FMT_IGNORE);
}
- if (un->un_f_power_condition_supported) {
+ /*
+ * We've encountered certain classes of drives that pass a TUR, but fail
+ * the START STOP UNIT when using power conditions, or worse leave the
+ * drive in an unusable state despite passing SSU. Strictly speaking,
+ * for SPC-4 or greater, no additional actions are required to make the
+ * drive operational when a TUR passes. If we have something that
+ * matches this condition, we continue on and presume the drive is
+ * successfully powered on.
+ */
+ if (un->un_f_power_condition_supported &&
+ SD_SCSI_VERS_IS_GE_SPC_4(un) && SD_PM_IS_IO_CAPABLE(un, level) &&
+ level == SD_SPINDLE_ACTIVE && tursval == 0) {
+ sval = 0;
+ } else if (un->un_f_power_condition_supported) {
char *pm_condition_name[] = {"STOPPED", "STANDBY",
"IDLE", "ACTIVE"};
SD_TRACE(SD_LOG_IO_PM, un,
@@ -7132,20 +7145,6 @@ sdpower(dev_info_t *devi, int component, int level)
}
- /*
- * We've encountered certain classes of drives that pass a TUR, but fail
- * the START STOP UNIT when using power conditions. Strictly speaking,
- * for SPC-4 or greater, no additional actions are required to make the
- * drive operational when a TUR passes. If we have something that
- * matches this condition, we continue on and presume the drive is
- * successfully powered on.
- */
- if (un->un_f_power_condition_supported && sval == ENOTSUP &&
- SD_SCSI_VERS_IS_GE_SPC_4(un) && SD_PM_IS_IO_CAPABLE(un, level) &&
- level == SD_SPINDLE_ACTIVE && tursval == 0) {
- sval = 0;
- }
-
/* Command failed, check for media present. */
if ((sval == ENXIO) && un->un_f_has_removable_media) {
medium_present = FALSE;