Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Jan 1996 14:02:30 -0800 (PST)
From:      Julian Elischer <julian@ref.tfs.com>
To:        dufault@hda.com (Peter Dufault)
Cc:        freebsd-scsi@freebsd.org
Subject:   Re: scsi cleanup
Message-ID:  <199601282202.OAA02211@ref.tfs.com>
In-Reply-To: <199601281418.JAA13687@hda.com> from "Peter Dufault" at Jan 28, 96 09:18:27 am

next in thread | previous in thread | raw e-mail | index | archive | help
Note.. scope widenned to FreeBSD-scsi

> 
> Julian: 
> 
> here is my wish list of things to do for a new release of the SCSI system.
> I haven't spent much time reviewing it today other than to remove a
> few items that have been fixed - I figure it is better to let you look
> at it and add your items or comment on mine.  This is from about
> 12-15-95.
> 
> Note that this is a list of things that ought to be done.  It is not
> prioritized and some things may be of less importance.
> 
> OVERALL:
> 
> Battle entropy. Reduce the size of the system 30% while adding features.
> Make it -Wall clean.

I agree that this might be possible..

> 
> Move FreeBSD specific code into one file.  Minimize inclusion of machine
> headers.  Reorganize with an eye toward embedability. (New note - this
> would also help with NetBSD et al).
yup
> 
> BUGS:
> 
> Analyze these SCSI-mentioning bugs:
> 
> [1995/03/11] kern/238      failed assertion in ncr.c --> no more scsi disk acce
> [1995/03/28] kern/275      qic-02 streamer won't work
not really SCSI? 
> [1995/03/28] kern/281      Messages printed when checking CD ROM device too ver
> [1995/04/04] kern/299      SCSI probes stop at ID 7 even for WIDE busses
Fixed
> [1995/04/06] kern/302      Changing st tapes after extract crashes system
> [1995/04/11] kern/336      make world fails on NCR-SCSI machine
fixed I believe
> [1995/04/20] kern/353      xcdplayer crashes machine (with NCR810 SCSI)
fixed I believe
> [1995/04/26] i386/369      AHA-154X-A problems
> [1995/05/07] kern/387      scsistrategy doesn't use bounce buffers
> [1995/06/01] kern/471      System can not access SCSI DAT tape.
possibly pilot error.. also some changes were done here
> [1995/06/18] misc/530      Failed install from SCSI tape
install error I think
> [1995/07/03] kern/586      Timeouts on SCSI Adaptec 2940
fixed
> [1995/07/05] kern/590      pager input errors on NCR SCSI 486 mainboard
> [1995/07/14] kern/614      SCSI tape timeout for forward space file is too shor
> [1995/07/27] kern/637      If used heavily, ahc will crash, with disk timeouts
> [1995/08/11] kern/674      quad speed cdrom not being found
> [1995/08/13] docs/681      bad description of Adaptec 2842 in LINT
> [1995/09/28] kern/753      my archive scsi tape drive does not work
> [1995/10/01] kern/757      Removal of mounted CD-ROM causes reboot & single use
> [1995/11/12] kern/820      scsi tape problems
> [1995/11/21] i386/833      SCSI hard disks time out during tape rewind - FDIV03
> 
> CONFIGURATION:
> 
> Kick off bus resets early in the probe time and come back
> later to look for the devices.  Look at any non-interrupt driven
> code and
> get the SCSI reprobe code working properly on all host adapters.

agreed. This requires that interrupts are fully set up
at the time of probing.. I'm not convinced of this..
also poling code might still be required for dumping core..
I believe that interrupts are suspended at this time.

> 
> Add good matching for driver configuration.  Support the
> configuration matching as ASCII instead of (or in addition to) the
> data structures so that it is easy to add configuration
> specification in "boot -c" and at run time.
> Add the ability to specify configuration in "boot -c".
> Think about adding a boot time loaded configuration
> description.

Not sure which configuration you are tlking about here..

>
> Reprobe device should be possible at any time.
> 
> Be sure you can work with the SCSI system even if only a host
> adapter was found at boot time.
I think this basically requires the existenc in a non-optional way
of the 'super-scsi' device or some equivalent.

> 
> Be sure you can LKM in a driver and configuration with a new type
> / reprobe the bus / have the new driver supercede any standard
> drivers that were matched at initial probe time.  This is especially
> useful for something like the CJ10 which comes on line as a scanner
> but really is a combo non-standard scanner / plotter / frame buffer and should
> have its own driver and not be an in-line exception to any scanner driver.
tricky!
I would suggest that to allow this we might have an ioctl to 
'free-up' a scsi slot.. disassociate the driver from the device, so that
it can be reprobed..
I don't think I'd trust a routine to figure out that there is now a
better match for a device, and do it automatically...

> 
> Move all compiled in configuration information down into the type
> driver it is associated with, e.g., tape information should only be
> down in the tape driver.
I agree and have been working in that direction....
> 
> GENERAL SUPPORT:
> 
> Resource allocation:  Have
> the number of queue slots available in each target and number of
> transactions available on the host adapter known, pass out non-conflicting
> requests first come - first serve, then start to line up at priority
> queues with the priority taken from the rt_prio to gain entry into the
> system.  Add reserved slots so that you can have, e.g., a
> reserved slots in a bus 0 host adapter, bus 0 disk, bus 1 host adapter,
> bus 1 CDROM recorder for minimal latency CDROM burning (or AV work,
> etc).
> 
> Remove "b_driver1" and "b_driver2", or at least "b_driver2",
> from the user mode SCSI.
I don't know why that is bad but it might be possible to 
colapse them to one.
> 
> Get SCSI_FREEZE and THAW working again so that you can quiet the
> bus for reprobing / powering up devices, etc.
ok
> 
> Clean up error handling.  Move all policy regarding when to reset
> the SCSI bus and when to reset targets up out of the host adapter
> drivers and into the common code.  Have a standard method of kicking
> the SCSI bus to get things working properly.
see next paragraph..
basically errorohandling should all be handled better than it is..

> 
> Clean up timeouts.  A device "in the process of
> becoming ready" should be waited on "forever" with a way of killing the
> transaction from a utility.  Device specific drivers should be able
> to specify a retry delay for SCSRET_RETRY instead of immediately
> kicking the retries off in the
> interrupt.
> 
> Add support for kern_devconf in "freebsd.c".
> 
> Remove "su.c".  Between configuring at specific devices and devfs
> we don't need it.
ok, that makes sense, (kind of)
> 
> TYPE DRIVERS:
> 
> Have a single start queue in scsi_driver.  Pull any other common
> code we can out of the type drivers into scsi_driver.
I'm not sure about  this one...
the trouble is that it get's ver hard to follow what's going on. and
the mechanisms needed to handle exceptions can be complicated
and error-prone. It gets hard to optimise for device types....

> 
> Get the CD-ROM writer code working.
joerg seems to have this under control.

> 
> Be a little less noisy about CD-ROM's at boot.
yep
also there are people asking for a CDROM ID-number fetching ioclt
so that they can get the contents of each drive in a changer drive.

> 
> Get the SCSI target interface working on something other than just
> the AHA-1542B working - specifically on the two drivers we have control
> of the firmware (NCR and ahc).  Add interfaces to support TCP-IP over
> SCSI.
now we're getting more long-term :)

> 
> Add support for shared disks.  Add the ability to reserve sections
> of the disk read only and read-write to support mounting read
> only partitions from multiple systems.
> 
> Move the scanner driver into the distribution.
ok, I have one here but it requiresa  certain library interface and 
I can't give that away so it's kinda useless in that regard.

> 
> HOST ADAPTER DRIVERS:
> 
> Tighten up the host adapter - common layer interface.  For example,
> I don't think host adapters need to know about sc_links.
hmmmm I think there might be call-backs that might be needed..
(not sure about this... you might be right)

> 
> Make the host adapter code smaller.  Pull as much as possible into
> a single host adapter interface file that gets moved into sys/scsi,
> and make the host adapter hooks as small as possible.
> 
> Fix it so you can use a 1542A.

anyone have one?

> 
> Reduce the size of the NCR driver so that it is less than 7000 lines.
> 


Add:
Justin would like a call-down from the generic code to the adapter at the time of allocating a scsi_transfer struct, so that he can also allocate a matching
adaptrer level struct and pin them together....

I want to write more documentation about how it all goes together.
The code needs to have more comments put in it.

places where 'common' code is called need to di\ocument what the common
code is doing for them, so that you don't need to keep
skipping back and forth between files to work out what the f*ck is going on.
some common code abstractions need to be rethought.. some of the 

sdopen() -> scsi_open() -> sd_open() hacks need to be 

examined to see if there isn't a less obtuse way of doing this sort of thing.
OR
at least we need to work out how to present this so that it's
more understandable.. MANY comments are needed throughout the
entire SCSI sysem.


julian
+----------------------------------+       ______ _  __
|   __--_|\  Julian Elischer       |       \     U \/ / On assignment
|  /       \ julian@ref.tfs.com    +------>x   USA    \ in a very strange
| (   OZ    ) 300 lakeside Dr. oakland CA. \___   ___ | country !
+- X_.---._/  USA+(510) 645-3137(wk)           \_/   \\            
          v



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199601282202.OAA02211>