I'm trying to issue a Bus and Device reset (at different times) to a
SATA drive. Unfortunately, I'm getting an EIO when I use
SG_SCSI_RESET with a SG_SCSI_RESET_BUS or SG_SCSI_RESET_DEVICE arg in
the int* on an sg device, and ENOTTY on an sd device.
So, I decided to try using the SAT interface via libata. One the face
of it, this looks like it should be easy... Device Reset is protocol
field = 9, don't do check condition, no tlength, tdir doesn't matter,
extend doesn't matter, etc.
So I issue:
85/12/00/00/00/00/00/00/00/00/00/00/00/00/00
but get an 05/24/00 error (invalid field in CDB)
So, I try the extend bit...
85/13/00/00/00/00/00/00/00/00/00/00/00/00/00
ditto
Maybe I need to manually set the SRST in the control field too...
85/13/00/00/00/00/00/00/00/00/00/00/00/00/04
05/24/00 bleh
Does anyone know how to issue HARD, SOFT, or DEVICE resets to sata
devices?
A followup... neither sg_reset worked, nor hdparm, and for similar
reasons. (other hdparm settings did.)
# hdparm -w /dev/sg0
/dev/sg0:
HDIO_DRIVE_RESET failed: Operation not permitted
# hdparm -w /dev/sda
/dev/sda:
HDIO_DRIVE_RESET failed: Inappropriate ioctl for device