Subject: Re: Problems with ccd (960413)
To: Justin T. Gibbs <gibbs@freefall.freebsd.org>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: current-users
Date: 05/15/1996 09:02:03
On Wed, 15 May 1996 06:51:44 -0700 
 "Justin T. Gibbs" <gibbs@freefall.freebsd.org> wrote:

 > >What are the SCBs, btw?  Some limited resource of the SCSI interface
 > >or something in the kernel or..?
 > 
 > SCSI Command Block.  An SCB contains all the information that the
 > controller requires to complete a command.  The 2742 can only store
 > 4 of them in its local memeory at once.

Nit: SCBs are an aic7xxx-ism ... not all chips use a data structure like 
it.  It's a data structure which a format defined by the hardware.  A 
Fujitsu MB87030 doesn't use anything like an SCB, for example...

...which brings me to another question...there are drivers out 
there, like NetBSD's MI ncr5380 driver, that cope with this "openings 
problem" Just Fine, even in the presence of hardware that has NO memory 
for SCBs or the SCB-equivalent.  In general, they cope with this by 
queuing the requests in the software machine ... The 5380 driver that 
David Jones wrote handles all of this really well...

...so, my question is, why doesn't the ahc driver queue these extra 
requests in software, rather than insisting on plopping all of them in 
the aic's memory at once?  When the ahc driver sees that a command is 
complete (and the SCBs free), it can immediately load the next request 
pending in the software queue.

The problem is when you have a polling ("immediate") request; you can't 
return to the caller without completing the command ... the 5380 driver 
handles this by ABORTing the command currently running on then 5380, if 
the command running on the 5380 is an interrupt-driven command.  This is 
safe, because there won't be re-entrance into the 5380 driver if a 
polling command is running (runs at a high-ish spl)

Sometimes I long for a 5380-based PCI SCSI card...the 5380: simple, 
sufficient.

----save the ancient forests - http://www.bayarea.net/~thorpej/forest/----
Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                               Home: 408.866.1912
NAS: M/S 258-6                                          Work: 415.604.0935
Moffett Field, CA 94035                                Pager: 415.428.6939