*BSD News Article 50016


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!news.sprintlink.net!howland.reston.ans.net!sol.ctr.columbia.edu!startide.ctr.columbia.edu!wpaul
From: wpaul@ctr.columbia.edu (Bill Paul)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: SCSI - AHA2742A Twin-Channel
Date: 3 Sep 1995 16:48:02 GMT
Organization: Columbia University Center for Telecommunications Research
Lines: 134
Message-ID: <42cm82$d0i@sol.ctr.columbia.edu>
References: <42amuj$k5b@nx2.hrz.uni-dortmund.de>
NNTP-Posting-Host: startide.ctr.columbia.edu
X-Newsreader: TIN [version 1.2 PL2]

Daring to challenge the will of the almighty Leviam00se,
Andreas Braukmann (NetAdmin) (ab@distler.maschinenbau.uni-dortmund.de)
had the courage to say:

: Hi,

:  ... I've got some trouble to use both SCSI-channels of my AHA2742AT under
:  2.0.5-950622-SNAP in a consistent way.

I had similar problems with a pre-2.0.5-RELEASE version of FreeBSD
and the same controller. I also filed a problem report about the wiring
down of the two SCSI busses which failed to work with two-channel
controllers. This was supposed to have been fixed, but I don't recall
whether or not the fix went into the tree before or after this snapshot.

(It also happens that I no longer have the machines with this controller
anymore, so I haven't persued the issue.)

:  The hostadapter supplies two SCSI-channels named 'A' and 'B'. Channel 'A'
:  may be connected to internal and external devices; channel 'B' to internal
:  devices only. Because of that, I've decided to put my fast harddisk on
:  channel 'B' and an external cabinet with slower devices (CD-ROM, tape, an
:  older harddisk) on channel 'A'.


: The problem:
: The aic7770 driver (/usr/src/sys/i386/scsi/aic7xxx.*) probes the channel
: 'A' before channel 'B'. This seems to be logical, but leads to the
: following annoying behavior:

: The first harddisk found at channel 'A' becomes sd0 (the second sd1 and so
: on) and the disks on channel 'B' sd??. Especially the device name for the
: disk with the root-partition is unpredictable. (Mind the possibility to
: have the external devices switched of.)

: Naturally I've considered to wire down the scsi-devices (kernel config
: file) in the following way:

: controller scbus0
: controller scbus1

: device          sd0 at scbus1 target 0 unit 0
: [...]
: device          sd4 at scbus0 target 0 unit 0

When you declare the two SCSI busses, I believe you're also allowed
to wire them to a particular bus on a particular controller, e.g.:

controller scbus0 at ahc0 bus 0
controller scbus1 at ahc0 bus 1

device		sd0 at scbus1 target 0 unit 0
device		sd4 at scbus0 target 0 unit 0

This is the only way for the kernel to know how you want the busses
assigned. Without it, it probably just goes back to making arbitrary
assignments again.

Get out your /sys/i386/conf/LINT file and check for comments about
special handling for twin channel controllers. If it's there, then
your snapshot has the fix for this problem and you need to try the
above syntax. If it's not there, then you need a newer snapshot.

: ... ... without any success .... 
: A kernel configured like this was booting right into a kernel panic.

: Tracing down the panic-message and some experiments leads to the
: assumption:
: The aic7xxx-driver interfaces to the kernel as one single scsi-bus?
: (Is this right?)

If it is, it shouldn't be.

: If this is the case -- how should one distinguish devices with same target
: ids (one of them on Channel A and the other on channel B) in the kernel
: configuration file?

Well, presumeably the 'scbusX at ahcX bus X' syntax helps the kernel
see things clearly, but if it assigns the same controller/target/lun
triple to two different devices, then something's more than a little
fishy.

[chop]
: channel 'A' device switched on
: ~~~~~~~~~~~~~~~~
: ahc0: reading board settings
: ahc0: 274x Twin Channel, A SCSI Id=7, B SCSI Id=7, aic7770 >= Rev E, 4 SCBs
: ahc0: Using Level Sensitive Interrupts
: ahc0: Downloading Sequencer Program...Done
: ahc0 at 0x5000-0x50ff irq 11 on eisa slot 5
: ahc0: Probing channel A
: ahc0 waiting for scsi devices to settle
: (ahc0:0:0): "SEAGATE [...]" type 0 fixed SCSI 1
: sd1(ahc0:0:0): Direct-Access [...]
: ahc0: Probing Channel B
: ahc0 waiting for scsi devices to settle
: (ahc0:0:0): "FUJITSU M2694ES-512 812A" type 0 fixed SCSI 2
: sd1(ahc0:0:0): Direct-Access 1033MB (2117025 512 byte sectors)
: ~~~~~~~~~~~~~~~~

: .. the system boots into 'panic', because the kernel cannot localize its
: root filesystem.

Now that's just too damn weird. I don't care if the SCSI code did get
confused by a possibly incorrect config file, you should never see
something like this. If the kernel didn't panic due to an inability
to mount its root filesystem, it would probably panic later the
moment you tried to access 'sd1.'

This is sort of a touchy issue. On the one hand, this is a single
physical device. On the other hand, it encompasses two physical
busses, which logically makes it seem like two physical devices.
On the third hand, we're trying to let one driver handle more
than one type of device, only some of which are twin-channel.

Clearly we don't have enough hands to go around.

: Any suggestions?

Again, try the other syntax in your kernel config file. If your
snapshot can't handle the new syntax, try to upgrade. If it still
doesn't work, ask on freebsd-hackers@freebsd.org. And if _that_
doesn't produce any results, file a bug report with send-pr.

-Bill
 
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~T~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Bill Paul            (212) 854-6020 | System Manager
Work:         wpaul@ctr.columbia.edu | Center for Telecommunications Research
Home:  wpaul@skynet.ctr.columbia.edu | Columbia University, New York City
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Møøse Illuminati: ignore it and be confused, or join it and be confusing!
~~~~~~ "Welcome to All Things BSDish! If it's not BSDish, it's crap!" ~~~~~~~