issuing device resets to SATA drives - Linux

This is a discussion on issuing device resets to SATA drives - Linux ; kernel 2.6.18.something 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, ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: issuing device resets to SATA drives

  1. issuing device resets to SATA drives

    kernel 2.6.18.something

    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?


  2. Re: issuing device resets to SATA drives

    On Aug 20, 11:38*am, BB wrote:
    > 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

+ Reply to Thread