Douglas Gilbert wrote:
I have a SCSI disk, which I want to spin down when the system is not in use. I do this by using sdparm, scsi-spin or sg-utils. These tools all spin down the SCSI drive by using an IOCTL. Problem is that the kernel doesn't spin the drive back up. When a process requests data from the disk (a simple ls), the kernel responds with an I/O error. After some of these errors, reiserfs marks the drive read-only.
Setting sdev->allow_restart in struct scsi_device will cause sense key/code/qual of 02/04/02 (not ready, initialization command required) to wake up the scsi error handler and will force scsi core to issue a start unit command to the disk. I added this a while back to handle ipr raid arrays which need a start unit command each time the adapter gets reset. It would be easy enough for sd to use this, either all the time, or only when directed to, or we could add a sysfs attribute to the disk to enable/disable this behavior. Brian - : send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html