Question about "Not Ready" SCSI error
Hallo everyone
Today one of my SCSI drives decided to shutdown for no obvious reason. I suspect heat or a bad power supply. Syslog shows a repeating stream of the following:
Jul 30 15:51:30 tony kernel: sd 0:0:0:0: Device not ready: <6>: Current: sense key=0x2 Jul 30 15:51:30 tony kernel: ASC=0x4 ASCQ=0x2 Jul 30 15:51:30 tony kernel: end_request: I/O error, dev sda, sector 617358
Google revealed[1] that the drive is waiting for a START UNIT command, but it seems that the kernel is not attempting to spin up the drive again.
After a complete power-cycle the drive worked again. I just wanted to know if this is a shortcoming in the SCSI error handling codepath.
Regards,
Patrick
Additional Info:
Kernel: 2.6.18-git (from 29-July-2006)
SCSI HW: Adaptec 3960D Ultra160 SCSI adapter
aic7899: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs
Harddisk: Vendor: IBM
Model: IC35L036UCD210-0 Rev: S5BA Type: Direct-Access ANSI SCSI revision: 03 Tagged Queuing enabled. Depth 64 FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 63)
[1] http://en.wikipedia.org/wiki/KCQ
2 04 02 Not Ready - need initialise command (start unit)
Hi,
Quoted 3 lines · Patrick Mau
Google revealed[1] that the drive is waiting for a START UNIT command, but it seems that the kernel is not attempting to spin up the drive again.
I don't know exactly if it's enough to requeue the scsi command, please comment on this, guys.
drivers/scsi/scsi_lib.c +1 -0
@@ -913,6 +913,7 @@ void scsi_io_completion(struct scsi_cmndif (sshdr.asc ==0x04 ) {switch (sshdr.ascq) {case 0x01 :/* becoming ready */ +case 0x02 :/* waiting for spin up */ case 0x04 :/* format in progress */ case 0x05 :/* rebuild in progress */ case 0x06 :/* recalculation in progress */
Quoted 7 lines · Johannes Weiner
Quoted 3 lines · Patrick Mau
Google revealed[1] that the drive is waiting for a START UNIT command, but it seems that the kernel is not attempting to spin up the drive again.
I don't know exactly if it's enough to requeue the scsi command, please comment on this, guys.
AFAIU, the scsi_eh (error handler) already has proper code for exactly this purpose, but the code is inactive. Any driver (SCSI low-level driver or SCSI command set driver) can activate it by setting scsi_device->allow_restart = 1.
Brian King posted a patch which lets you enable that flag at runtime:
"scsi: Add allow_restart sysfs class attribute", 2006-06-27
http://marc.theaimsgroup.com/?l=linux-scsi&m=115142503103468
The patch is in Linus' tree now.
http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=history;f=drivers/scsi/sd.c
Signature · 3 lines
Stefan Richter -=====-=-==- -=== ===== http://arcgraph.de/sr/
Hi,
Quoted 7 lines · Patrick Mau
Jul 30 15:51:30 tony kernel: sd 0:0:0:0: Device not ready: <6>: Current: sense key=0x2 Jul 30 15:51:30 tony kernel: ASC=0x4 ASCQ=0x2 Jul 30 15:51:30 tony kernel: end_request: I/O error, dev sda, sector 617358Google revealed[1] that the drive is waiting for a START UNIT command, but it seems that the kernel is not attempting to spin up the drive again.
Further looking at all the involved struct's, I found that it might be possible to call the driver's rescan function explicitely in the occured case.
Unfortunatly I don't have the appropriate hardware to test this :(
Hannes
Quoted 10 lines · Patrick Mau
Hallo everyone
Today one of my SCSI drives decided to shutdown for no obvious reason. I suspect heat or a bad power supply. Syslog shows a repeating stream of the following:
Jul 30 15:51:30 tony kernel: sd 0:0:0:0: Device not ready: <6>: Current: sense key=0x2 Jul 30 15:51:30 tony kernel: ASC=0x4 ASCQ=0x2 Jul 30 15:51:30 tony kernel: end_request: I/O error, dev sda, sector 617358
Quoted 6 lines
Google revealed[1] that the drive is waiting for a START UNIT command, but it seems that the kernel is not attempting to spin up the drive again.
After a complete power-cycle the drive worked again. I just wanted to know if this is a shortcoming in the SCSI error handling codepath.
I'll have to report that I've seen a few drives behaving similarly, both on 2.4.x and 2.6.x.
Is that an expected behavior from SCSI hard drives? Any SCSI guru would be able to answer this one?
Phil.
Quoted 1 line · Philippe Troin
Patrick Mau <[email protected]> writes:
...
Quoted 8 lines
Quoted 8 lines
Jul 30 15:51:30 tony kernel: sd 0:0:0:0: Device not ready: <6>: Current: sense key=0x2 Jul 30 15:51:30 tony kernel: ASC=0x4 ASCQ=0x2 Jul 30 15:51:30 tony kernel: end_request: I/O error, dev sda, sector 617358Google revealed[1] that the drive is waiting for a START UNIT command, but it seems that the kernel is not attempting to spin up the drive again.
Quoted 8 lines
Quoted 2 lines
After a complete power-cycle the drive worked again. I just wanted to know if this is a shortcoming in the SCSI error handling codepath.
I'll have to report that I've seen a few drives behaving similarly, both on 2.4.x and 2.6.x.
Is that an expected behavior from SCSI hard drives? Any SCSI guru would be able to answer this one?
I am not a SCSI guru but answer anyway. The gurus are over at [email protected].
Doug Gilbert has an overview about SCSI power management:
http://sg.torque.net/sg/power.html
Long ago Brian King submitted code to the SCSI error handler of Linux 2.6 that issues the START STOP UNIT command. This code is inactive per default to avoid clashes with USB disks.
http://marc.theaimsgroup.com/?l=linux-scsi&m=107702811830956
A recently merged patch allows to activate this code via a sysfs attribute. http://lkml.org/lkml/2006/7/30/261
I don't know if there is similar code for Linux 2.4.
Signature · 3 lines
Stefan Richter -=====-=-==- =--- ----= http://arcgraph.de/sr/