lkml.org 
[lkml]   [2007]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] libata: fix translation for START STOP UNIT
Applies to 2.6.20-rc6.

---

libata's SCSI translation for the SCSI START STOP UNIT command with the
START bit clear (i.e. stopping the drive) appears to be incorrect. It
sends an ATA STANDBY command with the time period set to 0, which the
code comment says means "now", but the ATA standard says this means
disable the standby timer, which effectively does nothing. Change this
to issue a STANDBY IMMEDIATE command which will actually spin the drive
down. The SAT (SCSI/ATA Translation) standard revision 9 concurs with
this choice.

Signed-off-by: Robert Hancock <hancockr@shaw.ca>

--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/


--- linux-2.6.20-rc6nv/drivers/ata/libata-scsi.c 2007-01-28 16:59:58.000000000 -0600
+++ linux-2.6.20-rc6nvedit/drivers/ata/libata-scsi.c 2007-01-28 17:30:12.000000000 -0600
@@ -983,11 +983,10 @@ static unsigned int ata_scsi_start_stop_
}

tf->command = ATA_CMD_VERIFY; /* READ VERIFY */
- } else {
- tf->nsect = 0; /* time period value (0 implies now) */
- tf->command = ATA_CMD_STANDBY;
- /* Consider: ATA STANDBY IMMEDIATE command */
- }
+ } else
+ /* Issue ATA STANDBY IMMEDIATE command */
+ tf->command = ATA_CMD_STANDBYNOW1;
+
/*
* Standby and Idle condition timers could be implemented but that
* would require libata to implement the Power condition mode page
\
 
 \ /
  Last update: 2007-01-29 02:33    [W:0.055 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site