Subject: Re: AIC7899-related problems in 1.5.2 & -current
To: Lista de NetBSD current <list11@sepc.edu.mx>
From: Johnny Lam <jlam@jgrind.org>
List: current-users
Date: 12/05/2001 14:10:45
--mYCpIKhGyMATD0i+
Content-Type: text/plain; charset=us-ascii

On Fri, Nov 30, 2001 at 10:23:15AM -0600, Lista de NetBSD current wrote:
> On Fri, 30 Nov 2001, Andy R wrote:
> > 
> > Johnny, don't have much advice but I have a similar
> > experience. We got some Dell worstations that in the
> > end are laid out quite like a Poweredge. They have the
> > AIC-7880 and AIC-7890 (I believe) adapters built in.
> 
> I have the same problem but my server is Dell PowerEdge
> model 4400 with two PentiumIII, 512 RAM, 7899 with two
> 80 pin hard disks, a 7880 with cdrom. These chips are
> built in mainboard.

The problem seems to be fixed in -current.  Based on the hint by Manuel
Bouyer, I've backported the fix to the 1.5.x release branch and submitted a
pullup request for NetBSD 1.5.3.  In the meantime, I've attached the patch
relative to 1.5.2 and the resulting dmesg for my Dell PowerEdge 1550.  Note
that the dual AIC-7899 adapters both attach correctly now.

	Cheers,

	-- Johnny Lam <jlam@jgrind.org>

--mYCpIKhGyMATD0i+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="pchb.diff"

Index: sys/arch/i386/pci/pchb.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/i386/pci/pchb.c,v
retrieving revision 1.18.4.1
diff -c -r1.18.4.1 pchb.c
*** pchb.c	2000/10/30 23:30:18	1.18.4.1
--- pchb.c	2001/12/03 16:02:37
***************
*** 101,108 ****
--- 101,111 ----
  	pcireg_t bcreg;
  	u_char bdnum, pbnum;
  	pcitag_t tag;
+ 	int doattach, attachflags;
  
  	printf("\n");
+ 	doattach = 0;
+ 	attachflags = pa->pa_flags;
  
  	/*
  	 * Print out a description, and configure certain chipsets which
***************
*** 114,120 ****
  	    PCI_REVISION(pa->pa_class));
  	switch (PCI_VENDOR(pa->pa_id)) {
  	case PCI_VENDOR_PEQUR:
! 		pbnum = pci_conf_read(pa->pa_pc, pa->pa_tag, 0x44);
  
  		if (pbnum == 0)
  			break;
--- 117,123 ----
  	    PCI_REVISION(pa->pa_class));
  	switch (PCI_VENDOR(pa->pa_id)) {
  	case PCI_VENDOR_PEQUR:
! 		pbnum = pci_conf_read(pa->pa_pc, pa->pa_tag, 0x44) & 0xff;
  
  		if (pbnum == 0)
  			break;
***************
*** 123,136 ****
  		 * This host bridge has a second PCI bus.
  		 * Configure it.
  		 */
! 		pba.pba_busname = "pci";
! 		pba.pba_iot = pa->pa_iot;
! 		pba.pba_memt = pa->pa_memt;
! 		pba.pba_dmat = pa->pa_dmat;
! 		pba.pba_bus = pbnum;
! 		pba.pba_flags = pa->pa_flags;
! 		pba.pba_pc = pa->pa_pc;
! 		config_found(self, &pba, pchb_print);
  		break;
  
  	case PCI_VENDOR_INTEL:
--- 126,142 ----
  		 * This host bridge has a second PCI bus.
  		 * Configure it.
  		 */
! 		doattach = 1;
! 		switch (PCI_PRODUCT(pa->pa_id)) {
! 		case PCI_PRODUCT_PEQUR_XX5:
! 		case PCI_PRODUCT_PEQUR_CNB20HE:
! 		case PCI_PRODUCT_PEQUR_CIOB20:
! 			if ((attachflags &
! 			    (PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED)) ==
! 			    PCI_FLAGS_MEM_ENABLED)
! 				attachflags |= PCI_FLAGS_IO_ENABLED;
! 			break;
! 		}
  		break;
  
  	case PCI_VENDOR_INTEL:
***************
*** 156,169 ****
  				 * This host bridge has a second PCI bus.
  				 * Configure it.
  				 */
! 				pba.pba_busname = "pci";
! 				pba.pba_iot = pa->pa_iot;
! 				pba.pba_memt = pa->pa_memt;
! 				pba.pba_dmat = pa->pa_dmat;
! 				pba.pba_bus = pbnum;
! 				pba.pba_flags = pa->pa_flags;
! 				pba.pba_pc = pa->pa_pc;
! 				config_found(self, &pba, pchb_print);
  				break;
  			}
  			break;
--- 162,168 ----
  				 * This host bridge has a second PCI bus.
  				 * Configure it.
  				 */
! 				doattach = 1;
  				break;
  			}
  			break;
***************
*** 213,230 ****
  				pbnum = (bcreg & 0x000000ff) + 1;
  				break;
  			}
! 			if (pbnum != 0) {
! 				pba.pba_busname = "pci";
! 				pba.pba_iot = pa->pa_iot;
! 				pba.pba_memt = pa->pa_memt;
! 				pba.pba_dmat = pa->pa_dmat;
! 				pba.pba_bus = pbnum;
! 				pba.pba_flags = pci_bus_flags();
! 				pba.pba_pc = pa->pa_pc;
! 				config_found(self, &pba, pchb_print);
! 			}
  			break;
  		}
  	}
  }
  
--- 212,233 ----
  				pbnum = (bcreg & 0x000000ff) + 1;
  				break;
  			}
! 			if (pbnum != 0)
! 				doattach = 1;
  			break;
  		}
+ 		break;
+ 	}
+ 
+ 	if (doattach) {
+ 		pba.pba_busname = "pci";
+ 		pba.pba_iot = pa->pa_iot;
+ 		pba.pba_memt = pa->pa_memt;
+ 		pba.pba_dmat = pa->pa_dmat;
+ 		pba.pba_bus = pbnum;
+ 		pba.pba_flags = attachflags;
+ 		pba.pba_pc = pa->pa_pc;
+ 		config_found(self, &pba, pchb_print);
  	}
  }
  

--mYCpIKhGyMATD0i+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="dmesg.FLATLAND"

NetBSD 1.5.3_ALPHA (GENERIC) #0: Tue Dec  4 10:24:19 EST 2001
    toor@flatland:/usr/obj/sys/arch/i386/compile/GENERIC
cpu0: Intel Pentium III (Coppermine) (686-class), 993.38 MHz
total memory = 511 MB
avail memory = 468 MB
using 6573 buffers containing 26292 KB of memory
BIOS32 rev. 0 found at 0xffe90
mainbus0 (root)
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled
pchb0 at pci0 dev 0 function 0
pchb0: Pequr Technology CNB20HE Host (rev. 0x23)
pci1 at pchb0 bus 1
pci1: no spaces enabled!
pchb1 at pci0 dev 0 function 1
pchb1: Pequr Technology CNB20HE Host (rev. 0x01)
pchb2 at pci0 dev 0 function 2
pchb2: Pequr Technology I/O Bridge (rev. 0x01)
pci2 at pchb2 bus 1
pci2: i/o space, memory space enabled
pchb3 at pci0 dev 0 function 3
pchb3: Pequr Technology I/O Bridge (rev. 0x01)
pci3 at pchb3 bus 2
pci3: i/o space, memory space enabled
ahc1 at pci3 dev 5 function 0
OptionMode = 3
ahc1: interrupting at irq 5
ahc1: aic7899 Wide Channel A, SCSI Id=7, 16/255 SCBs
scsibus0 at ahc1 channel 0: 16 targets, 8 luns per target
ahc2 at pci3 dev 5 function 1
OptionMode = 3
ahc2: interrupting at irq 3
ahc2: aic7899 Wide Channel B, SCSI Id=7, 16/255 SCBs
scsibus1 at ahc2 channel 0: 16 targets, 8 luns per target
fxp0 at pci0 dev 1 function 0: Intel i82557 Ethernet, rev 8
fxp0: interrupting at irq 11
fxp0: Ethernet address 00:06:5b:19:f5:ef, 10/100 Mb/s
inphy0 at fxp0 phy 1: i82555 10/100 media interface, rev. 4
inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
fxp1 at pci0 dev 2 function 0: Intel i82557 Ethernet, rev 8
fxp1: interrupting at irq 10
fxp1: Ethernet address 00:06:5b:19:f5:f0, 10/100 Mb/s
inphy1 at fxp1 phy 1: i82555 10/100 media interface, rev. 4
inphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
vga1 at pci0 dev 3 function 0: ATI Technologies product 0x4752 (rev. 0x27)
wsdisplay0 at vga1: console (80x25, vt100 emulation)
pcib0 at pci0 dev 15 function 0
pcib0: Pequr Technology ROSB4 SouthBridge (rev. 0x50)
pciide0 at pci0 dev 15 function 1: Pequr Technology IDE (rev. 0x00)
pciide0: bus-master DMA support present, but unused (no driver support)
pciide0: primary channel configured to compatibility mode
pciide0: primary channel interrupting at irq 14
atapibus0 at pciide0 channel 0
cd0 at atapibus0 drive 0: <SAMSUNG CD-ROM SN-124, , q009> type 5 cdrom removable
cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2
pciide0: secondary channel configured to compatibility mode
pciide0: secondary channel ignored (not responding; disabled or no drives?)
isa0 at pcib0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
pckbc0 at isa0 port 0x60-0x64
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: PC speaker
sysbeep0 at pcppi0
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
npx0 at isa0 port 0xf0-0xff: using exception 16
fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB, 80 cyl, 2 head, 18 sec
isapnp0: no ISA Plug 'n Play devices found
biomask f3ed netmask ffed ttymask ffef
scsibus0: waiting 2 seconds for devices to settle...
ahc1: target 0 using 16bit transfers
ahc1: target 0 synchronous at 40.0MHz, offset = 0x3f
ahc1: target 0 using tagged queuing
sd0 at scsibus0 target 0 lun 0: <SEAGATE, ST318404LC, 0005> SCSI3 0/direct fixed
sd0: 17366 MB, 14384 cyl, 6 head, 412 sec, 512 bytes/sect x 35566478 sectors
ahc1: target 0 using 16bit transfers
ahc1: target 0 synchronous at 40.0MHz, offset = 0x3f
ahc1: target 1 using 16bit transfers
ahc1: target 1 synchronous at 40.0MHz, offset = 0x3f
ahc1: target 1 using tagged queuing
sd1 at scsibus0 target 1 lun 0: <SEAGATE, ST318404LC, 0005> SCSI3 0/direct fixed
sd1: 17366 MB, 14384 cyl, 6 head, 412 sec, 512 bytes/sect x 35566478 sectors
ahc1: target 1 using 16bit transfers
ahc1: target 1 synchronous at 40.0MHz, offset = 0x3f
ahc1: target 2 using 16bit transfers
ahc1: target 2 synchronous at 40.0MHz, offset = 0x3f
ahc1: target 2 using tagged queuing
sd2 at scsibus0 target 2 lun 0: <SEAGATE, ST318404LC, 0005> SCSI3 0/direct fixed
sd2: 17366 MB, 14384 cyl, 6 head, 412 sec, 512 bytes/sect x 35566478 sectors
ahc1: target 2 using 16bit transfers
ahc1: target 2 synchronous at 40.0MHz, offset = 0x3f
ahc1: target 6 using 8bit transfers
ahc1: target 6 using asynchronous transfers
ses0 at scsibus0 target 6 lun 0: <DELL, 1x3 U2W SCSI BP, 1.21> SCSI2 3/processor fixed
ses0: SAF-TE Compliant Device
scsibus1: waiting 2 seconds for devices to settle...
sd1: no disk label
sd2: no disk label
boot device: sd0
root on sd0a dumps on sd0b
root file system type: ffs
wsdisplay0: screen 1 added (80x25, vt100 emulation)
wsdisplay0: screen 2 added (80x25, vt100 emulation)
wsdisplay0: screen 3 added (80x25, vt100 emulation)
wsdisplay0: screen 4 added (80x25, vt100 emulation)
wsmux1: connecting to wsdisplay0

--mYCpIKhGyMATD0i+--