aha2930u2

dledford at redhat.com dledford at redhat.com
Sun Jun 6 15:37:13 PDT 1999


Jonathan Stimmel wrote:
> 
> On Sun, 6 Jun 1999, Robert W. Rowe wrote:
> 
> > >Second q: in brief, how does the driver go about assigning devices? by PCI
> > >slot number? Or, in other words, what do I do to make sure my existing
> > devices
> > >end up being the same linux devices after I install a second host adapter?
> 
> Linux assigns /dev/ devices in the order that it finds them; so if you
> have:
>   - adaptor 1 : hard drives at 0 & 2, CDROM at 3
>   - adaptor 2 : hard drives at 1 & 5, CDROM at 3
> and Linux scans the first adaptor first, you'll get the following:
>   /dev/sda  == adaptor 1, device 0
>   /dev/sdb  == adaptor 1, device 2
>   /dev/sdc  == adaptor 2, device 1
>   /dev/sdd  == adaptor 2, device 5
>   /dec/scd0 == adaptor 1, device 3
>   /dev/scd1 == adaptor 2, device 3
> If the new adaptor (adaptor 2) is recognised first, then you'll mess up
> your current devices. I'm afraid I don't know whether the order is
> determined by PCI slot or IRQ number.

The ordering is determined in two ways.  Amongst different drivers (eg,
aic7xxx driver and ncr53c8xx driver) the order will be based upon the driver
startup sequence that you can find in /usr/src/linux/drivers/scsi/hosts.h. 
Controlling this order is usually as simple as compiling one driver into the
kernel and the rest as modules so that you will automatically get the compiled
in driver first and then all the modular drivers in the order you insert
them.  Or, do all the drivers as modules and simply control the insertion
order.  The second form of ordering is the multiple instances of cards
controlled by a single driver (eg, two 2940U2W cards).  In that case the
ordering is up to the driver.  In the case of the aic7xxx driver we order
things as VLB/EISA cards with BIOS enabled first (sorted by BIOS address from
lowest to highest).  PCI cards with their BIOS enabled second (sorted by PCI
slot #, except dual channel controllers that are always A then B or B then A
depending on the BIOS setting, and sorted from lowest to highest PCI slot #). 
VLB/EISA cards with BIOS disabled are third and are sorted the same as those
with BIOS enabled.  PCI cards with BIOS disabled are fourth and are sorted the
same as those with BIOS enabled.

Since we know that in an EISA/PCI machine that the BIOS will scan and activate
all EISA BIOSes before PCI BIOSes, we know that we can safely always put EISA
cards with BIOS enabled in front of PCI cards with BIOS enabled.  So, the
order of those four groups above never changes.  However, in the event that
your motherboard scans PCI cards from highest PCI slot # to lowest PCI slot #,
there is the option aic7xxx=reverse_scan which will cause us to reverse our
sort ordering for PCI cards that we find.  We will still preserve things like
channel A to B relationships on dual channel controllers, but we may move a
2940U2W in front of a 7880 controller for instance.  The one condition that
this doesn't catch (and for which there is no clean way to catch these cases)
are BIOSes on motherboards that have built in aic7xxx controllers and also
have some aic7xxx cards plugged into slots.  I've seen BIOSes that give the
options of 1) Built in controllers first, then scan from highest to lowest for
others or 2) Built in controllers first, then scan from lowest to highest for
others or 3) scan PCI slots first, then do built in controllers.  Obviously,
there is no clean way to detect this and there is no discernable ordering
present in all cases.

-- 
  Doug Ledford   <dledford at redhat.com>
   Opinions expressed are my own, but
      they should be everybody's.


To Unsubscribe: send mail to majordomo at FreeBSD.org
with "unsubscribe aic7xxx" in the body of the message




More information about the aic7xxx mailing list