start stop libata attached SATA disks, take 2
PATCH 1/1 start stop libata attached SATA disks, take 2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jeff,
Here is another (more successful) attempt at that patch.
ChangeLog:
- adds minimal START STOP UNIT SCSI command functionality to libata (follows sat-r05 apart from the IMMED bit).
- implements the TEST UNIT READY SCSI command as indicated
by sat-r05.
Patch against lk 2.6.13-rc5 .
Tested on my ST380013AS Seagate SATA disk with a Sil 3112 HBA. Stop (spin down [enter standby power mode]) seems to work as does start. Start takes 3.8 seconds to spin up on my disk. TEST UNIT READY works returning GOOD status (after 0 ms) when the disk is active or idle and the "initializing command required" sense (after 180 ms) when the disk is in standby power mode.
I looked a bit closer at the power condition states in SBC-2 and I assume there is an equivalence with SATA disks:
State Disk mechanics
- ----------------------------------
Active Spinning, heads on track Idle Spinning, heads parked Standby Spun down, " " Stop Spun down, " "
The difference between "standby" and "stop" is that an initializing command is required (i.e. START STOP UNIT command, start=1) to transition out of "stop" state (but not "standby"). As far as I can see ATA disks don't have a "stop" state that can be accessed via the ATA command set so the the SAT draft says to translate a SCSI START STOP UNIT command, start=0 (i.e. stop) into SATA disk being placed into standby mode. That is fine but a SATA (and PATA) disk doesn't need an initializing command to go into active state, any media access command will do that. This is all fine, I just find it a little curious what SAT is defining should happen for the TEST UNIT READY translation.
Doug Gilbert
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFC9HRqnayo+9E+FQIRAmWQAJ44Aq/qgo42MF/E6VHdREHVRxw7qwCfceGA kklbxZFB/fMgFXQChvC3A7k=
=a/U2
-----END PGP SIGNATURE-----
include/linux/ata.h2613rc5standby renamed from include/linux/ata.h +2 -0
@@ -108,6 +108,8 @@ /* ATA device commands */ ATA_CMD_CHK_POWER = 0xE5, /* check power mode */ + ATA_CMD_STANDBY = 0xE2, /* place in standby power mode */ + ATA_CMD_IDLE = 0xE3, /* place in idle power mode */ ATA_CMD_EDD = 0x90, /* execute device diagnostic */ ATA_CMD_FLUSH = 0xE7, ATA_CMD_FLUSH_EXT = 0xEA,
drivers/scsi/libata-scsi.c2613rc5stop renamed from drivers/scsi/libata-scsi.c +108 -2
134 lines not on this page · raw message
Quoted 6 lines · Douglas Gilbert
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Jeff,
Here is another (more successful) attempt at that patch.
Quoted 7 lines
ChangeLog:
- adds minimal START STOP UNIT SCSI command functionality to libata (follows sat-r05 apart from the IMMED bit).
- implements the TEST UNIT READY SCSI command as indicatedby sat-r05.Signed-off-by Douglas Gilbert <[email protected]>
Looks pretty decent, however...
Can you please resend as two patches:
#1: implement START STOP UNIT
#2: implement TEST UNIT READY
I need to think about TUR a bit more. Separating into two patches would allow me to apply SSU patch to upstream immediately, while applying the TUR feature to libata-dev.git respository, queueing it for further review and eventual upstream merge.
Jeff