linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Incorrect response to SK/ASC/ASCQ = x 02/04/01 (becoming ready)
@ 2004-08-22 16:21 Alan Stern
  2004-08-22 22:55 ` Nathan Bryant
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Alan Stern @ 2004-08-22 16:21 UTC (permalink / raw)
  To: SCSI development list; +Cc: Mike R.

The SCSI core doesn't react properly when it receives SK/ASC/ASCQ = x 
02/04/01 = Not Ready, Logical unit in process of becoming ready.

The core is complex enough that I can't tell exactly what's wrong or how
it should be fixed.  That particular sense data combination is spotted in
two different places: scsi_lib.c:scsi_io_completion() and
scsi_error.c:scsi_check_sense().  It's not clear which one is causing the
problem -- maybe they both are.

Anyway, the reaction in both routines is to requeue the request for
immediate retry.  Obviously that's the wrong thing to do.  The request
should be retried, yes, but only after a delay of, say, a second or so.  
(Presumably the queue should remain blocked during that time.)  And this
should keep happening for up to maybe 30 seconds.

Instead what happens is that all the retries get exhausted in a fraction 
of a second, which isn't long enough for any device to spin up.  The 
drivers then proceed blindly with whatever else they want to do, which 
generally incurs its own set of errors.

This problem seems to be particularly bad for USB DVD drives.  One user
was able to work around it by manually loading the usb-storage driver 20
to 30 seconds after plugging the drive into the computer.  Obviously it
would be much better to have the system do the right thing in the first
place.

I don't know enough about the SCSI core to change it properly.  Can
someone please help?

Alan Stern


^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: Incorrect response to SK/ASC/ASCQ = x 02/04/01 (becoming ready)
@ 2004-08-26 15:21 Pat LaVarre
  2004-08-26 15:29 ` Pat LaVarre
  0 siblings, 1 reply; 23+ messages in thread
From: Pat LaVarre @ 2004-08-26 15:21 UTC (permalink / raw)
  To: Alan Stern; +Cc: linux-scsi

 > > > the mid-layer assumes an operational device
 > > > won't spontaneously spin down,
 > ...
 > What other conditions produce something like this?

Spontaneous park and then spontaneous spin down occur with some devices 
if the host neglects to read or write thru the cache from the disc for 
a long time, like whole seconds.

This policy reduces noise, power, and media wear.  Guarantees a gentle 
park.  Etc.  Same device design rationale as ATA HDD power management.  
Not disputed in the device world, I hear.

 > 02/04/01 = Not Ready, ...
 > becoming ready.
 > ...
 > retries ... exhausted in ... a second, ...

I vote we distinguish:

a) the spin-up implied by insert or power on,
b) the spin down implied by eject, and
c) other spin up and spin down.

 > work around ... by [modprobe] after plugging the drive in...

Our host should not rapidly retry and give up on any of these, sure.

 > disable disconnects ...
 > the bus would be blocked
 > while waiting for START STOP UNIT ...

SCSI over USB disables disconnects always, I know.

I hear SCSI over IDE in practice disables disconnects almost always, 
though t13.org publishes a theory of more capable devices.

 > > 02/04/01 should be treated like a Busy status.
 > ...
 > a) the spin-up implied by insert or power on,

Many devices use x 2 04 01 to mean a spin-up implied by insert or power 
on.

I hear x 2 04 01 had a pre-Windows history of meaning please rapidly 
retry, but Windows support was so poor - including rapidly counted 
retries - that those other uses of x 2 04 01 have migrate out of PC 
peripheral device designs.

 > b) the spin down implied by eject, and

Many PDT x00 devices use x 2 04 00 to mean the spin down implied by 
eject, many PDT x05 devices use x 2 3A.

 > > > the mid-layer assumes an operational device
 > > > won't spontaneously spin down,
 > > ...
 > > the 02/04/02 handling code
 > ...
 > c) other spin up and spin down.

I see x 0 and x 2 04 00 and x 2 04 02 reported to mean a spontaneous 
spin down.  I hear x 0 works well in Windows only if the auto spin up 
completes in a few seconds.

Pat LaVarre


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2004-08-27  0:04 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-22 16:21 Incorrect response to SK/ASC/ASCQ = x 02/04/01 (becoming ready) Alan Stern
2004-08-22 22:55 ` Nathan Bryant
2004-08-22 23:32 ` James Bottomley
2004-08-22 23:56   ` Burn Alting
2004-08-23 15:31     ` James Bottomley
2004-08-23 17:08       ` Burn Alting
2004-08-26  2:54       ` Jeremy Higdon
2004-08-26 15:38         ` James Bottomley
2004-08-26 22:36           ` Jeremy Higdon
2004-08-27  0:03             ` Douglas Gilbert
2004-08-26 15:55   ` PATCH: (as355) Fix test for valid sense data present Alan Stern
2004-08-26 16:09     ` James Bottomley
2004-08-26 16:59       ` Alan Stern
2004-08-26 17:27         ` James Bottomley
2004-08-26 19:32           ` Alan Stern
2004-08-26 23:36           ` Douglas Gilbert
2004-08-26 17:20       ` Proposal for fixing READ_CAPACITY Alan Stern
2004-08-23 15:10 ` Incorrect response to SK/ASC/ASCQ = x 02/04/01 (becoming ready) Luben Tuikov
2004-08-23 16:05   ` Nathan Bryant
2004-08-23 18:29     ` Luben Tuikov
2004-08-24 22:04   ` Brian King
  -- strict thread matches above, loose matches on Subject: below --
2004-08-26 15:21 Pat LaVarre
2004-08-26 15:29 ` Pat LaVarre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).