Subject: Re: PMS driver and ISA
To: None <thorpej@nas.nasa.gov>
From: Mike Long <mike.long@analog.com>
List: port-i386
Date: 02/09/1996 13:11:13
>From: Jason Thorpe <thorpej@nas.nasa.gov>
>Date: Thu, 08 Feb 1996 14:40:15 -0800

>For various reasons, I'm doing some work on the ISA autoconfiguration 
>code (don't get your hopes up, please).  It's basically an idea that I 
>discussed with Charles, Christos, JT, et al at USENIX.
>
>The idea is to create an ISA iospace/iomem resource map so that once a 
>device is probed and attached, other devices won't be subsequently probed 
>at an overlapping iospace/iomem location.  This is to partially solve 
>problems with the adaptec/buslogic cards and the ed cards that get 
>trashed by the mcd (or whichever) probe.  Basically, the probe will fail 
>before it becomes destructive because a resource allocation will fail.

I like it.  This will also solve many other problems, like the same
device being found via both PCI and ISA drivers.  It will also make
sane ISA Plug&Play support *much* easier.

>The second stage of this will be a small, non-obtrusive change to 
>config_search(), which is the MI autoconfig routine that returns 
>"matching information" to pass onto the probe routines.  Basically, the 
>change is to add a field to the cfdriver structure, cd_priority, which 
>will tell config_search() how important it is that this device be probed 
>before somethine else.  For almost all drivers, this will require no 
>changes.  However, the ISA "ed" driver, for example, will get a "1" (or 
>higher) value in this field, telling config_search() to return it's 
>cfdata before something else.  Thus, the ed card will match/attach before 
>the mcd driver can probe and put it's prom in a strange state.

Is this really necessary?

While I haven't checked exhaustively, it looks like devices are put
into cfdata[] in ioconf.c in the same order as they are read from
.../conf/files.*.  If so, all one needs to do is make sure that (e.g.)
"ed" appears before "mcd", then add comments explaining why.

This proposed change will also slow autoconfiguration, because
config_search() must scan the entire cfdata[] array, instead of
short-circuiting as soon as it finds an eligible device instance.

Doesn't the autoconfig system already have a prioritization scheme
(value returned by match routine), that ISA isn't using?
-- 
Mike Long <mike.long@analog.com>           http://www.shore.net/~mikel
VLSI Design Engineer         finger mikel@shore.net for PGP public key
Analog Devices, CPD Division          CCBF225E7D3F7ECB2C8F7ABB15D9BE7B
Norwood, MA 02062 USA       (eq (opinion 'ADI) (opinion 'mike)) -> nil