From tedm@testing.rdrop.com  Fri Jan  3 22:02:12 1997
Received: from agora.rdrop.com (root@agora.rdrop.com [199.2.210.241])
          by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id WAA02296
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 3 Jan 1997 22:02:12 -0800 (PST)
Received: by agora.rdrop.com with UUCP (Smail3.1.29.1 #17)
	id m0vgPBG-0008vdC; Fri, 3 Jan 97 22:02 PST
Received: from testing.rdrop.com ([198.6.35.101]) by toybox (8.6.12/8.6.12) with ESMTP id JAA05409 for <FreeBSD-gnats-submit@freebsd.org>; Fri, 3 Jan 1997 09:25:06 -0800
Received: (from root@localhost)
          by testing.rdrop.com (8.8.4/8.8.4)
	  id JAA01699; Fri, 3 Jan 1997 09:25:30 -0800 (PST)
Message-Id: <199701031725.JAA01699@testing.rdrop.com>
Date: Fri, 3 Jan 1997 09:25:30 -0800 (PST)
From: root@testmach%toybox@agora.rdrop.com
Reply-To: tedm@agora.rdrop.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: Buslogic SCSI driver bad probe of 742A early revision IRQ and version
X-Send-Pr-Version: 3.2

>Number:         2367
>Category:       conf
>Synopsis:       Buslogic SCSI driver bad probe of 742A EISA card
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gibbs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan  3 22:10:01 PST 1997
>Closed-Date:    Sun Sep 12 15:42:47 PDT 1999
>Last-Modified:  Sun Sep 12 15:44:38 PDT 1999
>Originator:     Ted Mittelstaedt
>Release:        FreeBSD 2.2-CURRENT i386
>Organization:
Cool Dudes Club 
>Environment:
private test network

	

I have 5 computers on a private Ethernet network in my home, the bug is with
a machine with the following configuration:

CompuAdd 433E MC full tower, machine was manufactured in mid 1992.
Intel 486DX266 processor
8 EISA slots, one of which is a VLB slot
6 slots are busmaster slots, one of which contains SCSI card
Bustek (Buslogic) revision G 742A SCSI card, firmware version 2.21
1 16MB simm
Operating system shows the same bug on all versions of FreeBSD from 2.1.5 on
up, I tested it with a boot floppy from 2.2 current.

Following is the bootlog for the hardware configuration

Jan  3 02:38:06 testing /kernel: FreeBSD 2.1.6-RELEASE #0: Mon Dec 30 11:44:09 PST 1996
Jan  3 02:38:06 testing /kernel:     root@testing.teds.com:/usr/src/sys/compile/TEDS
Jan  3 02:38:06 testing /kernel: CPU: i486DX (486-class CPU)
Jan  3 02:38:06 testing /kernel: real memory  = 16777216 (16384K bytes)
Jan  3 02:38:07 testing /kernel: avail memory = 14929920 (14580K bytes)
Jan  3 02:38:07 testing /kernel: eisa0: <CPD03 (System Board)>
Jan  3 02:38:07 testing /kernel: Probing for devices on the EISA bus
Jan  3 02:38:07 testing /kernel: bt0: <Buslogic 74xB SCSI host adapter> at 0x330-0x333 0x1c00-0x1cff irq 9 on eisa0 slot 1
Jan  3 02:38:07 testing /kernel: bt0: Bt742A/G0-(32bit) bus
Jan  3 02:38:07 testing /kernel: bt0: reading board settings, busmastering, int=9
Jan  3 02:38:07 testing /kernel: bt0: version 2.21, async only, parity, 64 mbxs, 32 ccbs
Jan  3 02:38:07 testing /kernel: bt0: Not using Strict Round robin scheme
Jan  3 02:38:07 testing /kernel: bt0 waiting for scsi devices to settle
Jan  3 02:38:08 testing /kernel: (bt0:0:0): "DEC DSP5200S T384" type 0 fixed SCSI 2
Jan  3 02:38:08 testing /kernel: sd0(bt0:0:0): Direct-Access 1908MB (3907911 512 byte sectors)
Jan  3 02:38:08 testing /kernel: (bt0:4:0): "TOSHIBA CD-ROM XM-3401TA 3312" type 5 removable SCSI 2
Jan  3 02:38:08 testing /kernel: cd0(bt0:4:0): CD-ROM 
Jan  3 02:38:08 testing /kernel: cd0(bt0:4:0): NOT READY asc:3a,0 Medium not present
Jan  3 02:38:08 testing /kernel: can't get the size
Jan  3 02:38:08 testing /kernel: 
Jan  3 02:38:08 testing /kernel: (bt0:6:0): "ARCHIVE ANCDA 2800 28889 -900" type 1 removable SCSI 1
Jan  3 02:38:08 testing /kernel: st0(bt0:6:0): Sequential-Access density code 0x0,  drive empty
Jan  3 02:38:09 testing /kernel: Probing for devices on the ISA bus:
Jan  3 02:38:09 testing /kernel: sc0 at 0x60-0x6f irq 1 on motherboard
Jan  3 02:38:09 testing /kernel: sc0: VGA color <16 virtual consoles, flags=0x0>
Jan  3 02:38:09 testing /kernel: ed0 at 0x300-0x31f irq 10 maddr 0xd8000 msize 16384 on isa
Jan  3 02:38:09 testing /kernel: ed0: address 00:00:c0:1f:cf:23, type WD8013EP (16 bit) 
Jan  3 02:38:09 testing /kernel: sio0 at 0x3f8-0x3ff irq 4 on isa
Jan  3 02:38:09 testing /kernel: sio0: type 16450
Jan  3 02:38:09 testing /kernel: sio1 at 0x2f8-0x2ff irq 3 on isa
Jan  3 02:38:09 testing /kernel: sio1: type 16450
Jan  3 02:38:09 testing /kernel: sio2 not found at 0x3e8
Jan  3 02:38:10 testing /kernel: sio3: disabled, not probed.
Jan  3 02:38:10 testing /kernel: lpt0 at 0x378-0x37f irq 7 on isa
Jan  3 02:38:10 testing /kernel: lpt0: Interrupt-driven port
Jan  3 02:38:10 testing /kernel: lp0: TCP/IP capable interface
Jan  3 02:38:10 testing /kernel: pca0 on motherboard
Jan  3 02:38:10 testing /kernel: pca0: PC speaker audio driver
Jan  3 02:38:11 testing /kernel: fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa
Jan  3 02:38:11 testing /kernel: fdc0: unknown IC type a0
Jan  3 02:38:11 testing /kernel: fd0: 1.44MB 3.5in
Jan  3 02:38:11 testing /kernel: fd1: 1.2MB 5.25in
Jan  3 02:38:11 testing /kernel: bt: unit number (1) too high
Jan  3 02:38:11 testing /kernel: bt1 not found at 0x330
Jan  3 02:38:11 testing /kernel: npx0 on motherboard
Jan  3 02:38:11 testing /kernel: npx0: INT 16 interface


>Description:

	

The problem is that if I EISA-config the SCSI adapter to any IRQ number other
than Interrupt 9, the machine boots, but as soon as the kernel is loaded
and switches over to the compiled-in Buslogic driver in the kernel the SCSI
system times out attempting to read the disk.  Also, the boot probe shows
the interrupt probed at 9.  An example of this when the card is configured
to use Interrupt 12 (it's default) follows:

-------snip snip------------
Jan  3 02:38:07 testing /kernel: avail memory = 14929920 (14580K bytes)
Jan  3 02:38:07 testing /kernel: eisa0: <CPD03 (System Board)>
Jan  3 02:38:07 testing /kernel: Probing for devices on the EISA bus
Jan  3 02:38:07 testing /kernel: bt0: <Buslogic 74xB SCSI host adapter> at 0x330-0x333 0x1c00-0x1cff irq 9 on eisa0 slot 1
Jan  3 02:38:07 testing /kernel: bt0: Bt742A/G0-(32bit) bus
Jan  3 02:38:07 testing /kernel: bt0: reading board settings, busmastering, int=12
Jan  3 02:38:07 testing /kernel: bt0: version 2.21, async only, parity, 64 mbxs, 32 ccbs
------------snip snip---------

As you see, the first probe reads the wrong IRQ number of 9, while the second
probe reads the correct IRQ number of 12.  Unfortunately, the driver thinks
that the IRQ is 9.

The related problem to this is that the probe identifies the card as a 742xB
card, when in reality it is a 742A card.  This is probably because the
/usr/src/sys/i386/eisa/bt74x.c file doesen't have a separate test for the
742A card.

>How-To-Repeat:

	

EISA-config the Buslogic 742A as any IRQ other than 9

I don't believe that this problem occurs on the PCI Buslogic cards, only on
the EISA card (742) the reason is that one of my other machines is a PCI
machine with a Buslogic PCI scsi adapter in it, and I test-booted FreeBSD
on it and it worked.

This problem DIDN'T occur with FreeBSD version 1.1.5.1 on this machine!

This problem affects the installation floppy, what happens is that the
system boots, then hangs for a long time.  Very annoying!

>Fix:
	
	

I am getting by by EISA-configing the SCSI adapter to Interrupt 9, which makes
the real IRQ in agreement with the wrongly probed IRQ number.
>Release-Note:
>Audit-Trail:

From: j@uriah.heep.sax.de (J Wunsch)
To: tedm@agora.rdrop.com
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: conf/2367: Buslogic SCSI driver bad probe of 742A early revision IRQ and version
Date: Sat, 4 Jan 1997 11:40:30 +0100

 As root@testmach%toybox, UNEXPECTED_DATA_AFTER_ADDRESS@.SYNTAX-ERROR. wrote:
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 Eeek! :)
 
 > Jan  3 02:38:07 testing /kernel: bt0: <Buslogic 74xB SCSI host adapter> at 0x330-0x333 0x1c00-0x1cff irq 9 on eisa0 slot 1
 > Jan  3 02:38:07 testing /kernel: bt0: Bt742A/G0-(32bit) bus
 
 It's been a while ago that i've been using a Bt742A.  I remember that
 it wasn't totally unproblematical for me either.
 
 . turn off ISA DMA emulation,
 . use level-triggered IRQ,
 
 and with FreeBSD > 2.1:
 
 > Jan  3 02:38:11 testing /kernel: bt: unit number (1) too high
 > Jan  3 02:38:11 testing /kernel: bt1 not found at 0x330
 
 ...disable the ISA Buslogic driver.  Since the EISA device will also
 respond on the ISA addresses, the driver gets confused otherwise.
 
 > This problem DIDN'T occur with FreeBSD version 1.1.5.1 on this machine!
 
 Because it didn't have EISA controller code, so the card has been
 handled as some sort of an ``extended ISA'' device.  There was
 definately no EISA autoprobing in FreeBSD <= 2.1R, but it is there
 now.
 
 -- 
 cheers, J"org
 
 joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
 Never trust an operating system you don't have sources for. ;-)

From: tedm@agora.rdrop.com
To: joerg_wunsch@uriah.heep.sax.de, FreeBSD-gnats-submit@FreeBSD.org
Cc:  Subject: Re: conf/2367: Buslogic SCSI driver bad probe of 742A early revision IRQ and version
Date: Fri, 03 Jan 97 21:45:09 +0900

 //----------------------------------------------------------------------------
 // Ted Mittelstaedt      See my "Network Community" columns online 
 //  tedm@agora.rdrop.com         at http://www.computerbits.com
 //  tedm%toybox@agora.rdrop.com
 //--- forwarded letter -------------------------------------------------------
 > X-Mailer: Mutt 0.55-PL10
 > MIME-Version: 1.0
 > Date: Sat, 04 Jan 97 11:40:30 +0100
 > From: j@uriah.heep.sax.de
 > To: tedm@agora.rdrop.com
 > Reply-To: joerg_wunsch@uriah.heep.sax.de
 > Cc: FreeBSD-gnats-submit@FreeBSD.org
 > Subject: Re: conf/2367: Buslogic SCSI driver bad probe of 742A early revision IRQ 
 and version
 
 > 
 > As root@testmach%toybox, UNEXPECTED_DATA_AFTER_ADDRESS@.SYNTAX-ERROR. wrote:
 >    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 > Eeek! :)
 > 
 
 Looks like I munged that one.  I just threw together the mail routing quickly,
 the machine is actually not truly reachable yet.  The address should have been:
 
 toybox!testmach!root@agora.rdrop.com
 
 but it would have bounced anyhow.  Besides that, the address isin't truly legal.
 (the mailer on agora.rdrop.com could have made sense of it but that's it)
 
 > > Jan  3 02:38:07 testing /kernel: bt0: <Buslogic 74xB SCSI host adapter> at 
 0x330-0x333 0x1c00-0x1cff irq 9 on eisa0 slot 1
 > > Jan  3 02:38:07 testing /kernel: bt0: Bt742A/G0-(32bit) bus
 > 
 > It's been a while ago that i've been using a Bt742A.  I remember that
 > it wasn't totally unproblematical for me either.
 
 Kind of ironic, since the monolithic Buslogic driver was derived from driver
 code from the 742A EISA card!
 
 > 
 > . turn off ISA DMA emulation,
 > . use level-triggered IRQ,
 
 ISA DMA emulation was turned off.  I had it to edge-triggered interrupts, but
 setting to level-trigger doesen't make any difference.
 
 > 
 > and with FreeBSD > 2.1:
 > 
 > > Jan  3 02:38:11 testing /kernel: bt: unit number (1) too high
 > > Jan  3 02:38:11 testing /kernel: bt1 not found at 0x330
 > 
 > ...disable the ISA Buslogic driver.  Since the EISA device will also
 > respond on the ISA addresses, the driver gets confused otherwise.
 >
 
 I tried disabling the bt driver, this did make the above error message about
 bt unit number 1 too high go away, and the kernel did boot properly.  This is
 probably something that should go into the install FAQ, is the same problem present 
 with the Adaptec 1740 card responding as a 1540 as well?
 
 I also tried switching the interrupt to IRQ12 with the bt driver disabled, the
 EISA probe _still_ thinks that the interrupt is at IRQ 9, and the boot process halts.
 So, despite the disabled bt ISA driver, the EISA driver is still not correctly 
 autoprobing.  The annoying thing is that when the driver reads the actual card 
 settings, it comes up with IRQ12, but it is still using the initial probe of IRQ 9 
 from the EISA bus which is wrong.
  
 > > This problem DIDN'T occur with FreeBSD version 1.1.5.1 on this machine!
 > 
 > Because it didn't have EISA controller code, so the card has been
 > handled as some sort of an ``extended ISA'' device.  There was
 > definately no EISA autoprobing in FreeBSD <= 2.1R, but it is there
 > now.
 > 
 > -- 
 > cheers, J"org
 > 
 > joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
 > Never trust an operating system you don't have sources for. ;-)
 > 
Responsible-Changed-From-To: freebsd-bugs->gibbs 
Responsible-Changed-By: mpp 
Responsible-Changed-When: Mon Feb 17 08:56:27 PST 1997 
Responsible-Changed-Why:  
Last one to really touch this driver. 
State-Changed-From-To: open->feedback 
State-Changed-By: gibbs 
State-Changed-When: Mon Nov 2 11:05:02 PST 1998 
State-Changed-Why:  
The EISA probe for the BusLogic cards could be modified to only fetch the 
I/O port from the EISA configuration registers and then attempt to query 
the card for other information using the bt command interface.  The goal 
of the EISA probe was to limit the amount of invasive operations performed 
in order to determine resource requirements, but it may be impossible to 
properly support older cards without being more invasive. 

Do you happen to still have this card?  If so, I'd love to borrow it for 
a bit and use it to fine tune the EISA probe. 

From: "Ted Mittelstaedt" <tedm@toybox.placo.com>
To: <freebsd-gnats-submit@freebsd.org>, <tedm@agora.rdrop.com>
Cc:  
Subject: Re: conf/2367: Buslogic SCSI driver bad probe of 742A EISA card
Date: Sun, 12 Sep 1999 00:56:05 -0700

 Believe it or not I still have this machine.  (Hey, those old 486 EISA boxes
 are stable
 as locomotives - weigh as much as one too)
 
 I have verified that this problem is corrected in FreeBSD 3.2 RELEASE, on
 the same hardware setup.
 
 Ted
 
 
State-Changed-From-To: feedback->closed 
State-Changed-By: gibbs 
State-Changed-When: Sun Sep 12 15:42:47 PDT 1999 
State-Changed-Why:  
I fixed the EISA probe code for the bt driver during the CAM conversion 
and the originator has confirmed the fix. 
>Unformatted:
