aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sd.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-15 15:39:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-15 15:39:44 -0400
commit22a37bcb7857541eb2d37806c4744ee2530baa98 (patch)
tree9b3e1a8165908ffa74b2559924ee0f18488667ba /drivers/scsi/sd.c
parent849c529f57020cc47085400edd5e641d95cd4faf (diff)
parent82f06e86117680ada35fdb76c8852268d994cd99 (diff)
Merge branch 'sbp2-spindown' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
* 'sbp2-spindown' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: ieee1394: sbp2: spin disks down on suspend and shutdown firewire: fw-sbp2: spin disks down on suspend and shutdown ieee1394: sbp2: fix spindown for PL-3507 and TSB42AA9 firmwares firewire: fw-sbp2: fix spindown for PL-3507 and TSB42AA9 firmwares scsi: sd: optionally set power condition in START STOP UNIT
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r--drivers/scsi/sd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 01cefbb2d539..d53312c42547 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1124,6 +1124,8 @@ sd_spinup_disk(struct scsi_disk *sdkp)
1124 cmd[1] = 1; /* Return immediately */ 1124 cmd[1] = 1; /* Return immediately */
1125 memset((void *) &cmd[2], 0, 8); 1125 memset((void *) &cmd[2], 0, 8);
1126 cmd[4] = 1; /* Start spin cycle */ 1126 cmd[4] = 1; /* Start spin cycle */
1127 if (sdkp->device->start_stop_pwr_cond)
1128 cmd[4] |= 1 << 4;
1127 scsi_execute_req(sdkp->device, cmd, DMA_NONE, 1129 scsi_execute_req(sdkp->device, cmd, DMA_NONE,
1128 NULL, 0, &sshdr, 1130 NULL, 0, &sshdr,
1129 SD_TIMEOUT, SD_MAX_RETRIES); 1131 SD_TIMEOUT, SD_MAX_RETRIES);
@@ -1790,6 +1792,9 @@ static int sd_start_stop_device(struct scsi_disk *sdkp, int start)
1790 if (start) 1792 if (start)
1791 cmd[4] |= 1; /* START */ 1793 cmd[4] |= 1; /* START */
1792 1794
1795 if (sdp->start_stop_pwr_cond)
1796 cmd[4] |= start ? 1 << 4 : 3 << 4; /* Active or Standby */
1797
1793 if (!scsi_device_online(sdp)) 1798 if (!scsi_device_online(sdp))
1794 return -ENODEV; 1799 return -ENODEV;
1795 1800