[6118] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

Guru required: BUSY status

daemon@ATHENA.MIT.EDU (grant@torque.net)
Thu Mar 18 15:59:56 1999

From: grant@torque.net
To: linux-scsi@vger.rutgers.edu
Date: 	Thu, 18 Mar 1999 12:56:49 -0500 (EST)


I've been working for the last few months on new drivers for several
parallel port SCSI adapters.  I've recently got hung up on some problems
related to support for scanner devices.  

I believe that I have identified a mis-feature of the SCSI core, but
perhaps I am mistaken.

According to the SCSI-II spec, a Scanner may not be able to respond
immediately to a request for data.  It is permitted to respond by
disconnecting and reconnecting at a later time, or by returning 
BUSY status in the status phase.  

All reasonable host adapters will allow the device to disconnect, but
most parallel port adapters are not so reasonable.  The trouble is that
many of them implement the SCSI protocol in the driver, rather than
having the hardware detect a reselection and interrupt the driver.

Detecting a reselection in a polling driver is not a satisfactory
option - the initiator must respond to reselection within 200us, so
the CPU would be dedicated to watching for the reselection.  

As far as I can tell, the scsi mid-level code assumes that a BUSY
status is always an error, and the _new_ eh code appears to respond
by issuing a reset.  

I am certainly not an expert on the SCSI standard - but it would appear
that Linux's behaviour here is just wrong.   

I'm thinking of a hacky solution, but would like some advice from
the experts about issues I might be missing.  

What I propose is to detect the BUSY status in the low-level driver,
sleep for a short time, and then retry the command, without ever alerting 
the mid-level code.  This seems a fairly obvious solution, but I 
might be missing something.  (In particular, I'm worried about the 
possibility of the mid-level code timing out and aborting the command.)

Any comments ?

--------------------------------------------------------------------------
Grant R. Guenther                                         grant@torque.net
--------------------------------------------------------------------------

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu

home help back first fref pref prev next nref lref last post