* Question about "Not Ready" SCSI error
@ 2006-07-30 18:10 Patrick Mau
2006-07-30 21:52 ` Johannes Weiner
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Patrick Mau @ 2006-07-30 18:10 UTC (permalink / raw)
To: Linux Kernel
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)
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Question about "Not Ready" SCSI error
2006-07-30 18:10 Question about "Not Ready" SCSI error Patrick Mau
@ 2006-07-30 21:52 ` Johannes Weiner
2006-07-30 23:22 ` Stefan Richter
2006-07-30 22:28 ` Johannes Weiner
2006-07-31 23:13 ` Philippe Troin
2 siblings, 1 reply; 6+ messages in thread
From: Johannes Weiner @ 2006-07-30 21:52 UTC (permalink / raw)
To: Linux Kernel
[-- Attachment #1: Type: text/plain, Size: 366 bytes --]
Hi,
On Sun, Jul 30, 2006 at 08:10:19PM +0200, Patrick Mau wrote:
> 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.
Signed-off-by: Johannes Weiner <hnazfoo@gmail.com>
[-- Attachment #2: scsi_lib.patch --]
[-- Type: text/plain, Size: 480 bytes --]
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 077c1c6..545b900 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -913,6 +913,7 @@ void scsi_io_completion(struct scsi_cmnd
if (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 */
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: Question about "Not Ready" SCSI error
2006-07-30 21:52 ` Johannes Weiner
@ 2006-07-30 23:22 ` Stefan Richter
0 siblings, 0 replies; 6+ messages in thread
From: Stefan Richter @ 2006-07-30 23:22 UTC (permalink / raw)
To: Johannes Weiner; +Cc: linux-kernel, Patrick Mau
Johannes Weiner wrote:
> On Sun, Jul 30, 2006 at 08:10:19PM +0200, Patrick Mau wrote:
>> 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
--
Stefan Richter
-=====-=-==- -=== =====
http://arcgraph.de/sr/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Question about "Not Ready" SCSI error
2006-07-30 18:10 Question about "Not Ready" SCSI error Patrick Mau
2006-07-30 21:52 ` Johannes Weiner
@ 2006-07-30 22:28 ` Johannes Weiner
2006-07-31 23:13 ` Philippe Troin
2 siblings, 0 replies; 6+ messages in thread
From: Johannes Weiner @ 2006-07-30 22:28 UTC (permalink / raw)
To: Linux Kernel
Hi,
On Sun, Jul 30, 2006 at 08:10:19PM +0200, Patrick Mau wrote:
> 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.
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Question about "Not Ready" SCSI error
2006-07-30 18:10 Question about "Not Ready" SCSI error Patrick Mau
2006-07-30 21:52 ` Johannes Weiner
2006-07-30 22:28 ` Johannes Weiner
@ 2006-07-31 23:13 ` Philippe Troin
2006-08-01 5:56 ` Stefan Richter
2 siblings, 1 reply; 6+ messages in thread
From: Philippe Troin @ 2006-07-31 23:13 UTC (permalink / raw)
To: Patrick Mau; +Cc: Linux Kernel
Patrick Mau <mau@oscar.ping.de> writes:
> 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.
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Question about "Not Ready" SCSI error
2006-07-31 23:13 ` Philippe Troin
@ 2006-08-01 5:56 ` Stefan Richter
0 siblings, 0 replies; 6+ messages in thread
From: Stefan Richter @ 2006-08-01 5:56 UTC (permalink / raw)
To: Philippe Troin; +Cc: Patrick Mau, Linux Kernel
Philippe Troin wrote:
> Patrick Mau <mau@oscar.ping.de> writes:
...
>> 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.
>
> 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
linux-scsi@vger.kernel.org.
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.
--
Stefan Richter
-=====-=-==- =--- ----=
http://arcgraph.de/sr/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-08-01 7:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-30 18:10 Question about "Not Ready" SCSI error Patrick Mau
2006-07-30 21:52 ` Johannes Weiner
2006-07-30 23:22 ` Stefan Richter
2006-07-30 22:28 ` Johannes Weiner
2006-07-31 23:13 ` Philippe Troin
2006-08-01 5:56 ` Stefan Richter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox