Subject: ahc/aic7899 and smartctl
To: None <port-i386@netbsd.org>
From: Scott Presnell <srp@tworoads.net>
List: port-i386
Date: 01/24/2005 16:01:46
Hi Folks,
	I got ahold of smartmontools-5.32 for the TapeAlert functionality.
Probes of drives on the ATA bus work fine, Probes on my ahc/aic7899 busses
result in ahc timeouts (locked bus, bad news). Sometimes I get a little data
before the timeout.  I've tried harddrives on the bus and a tape drive. Each 
command tried would have been a read-only event (e.g. smartctl -a /dev/sd0d)

Clearly these two don't play well together: should I be filing a bug report,
or is this a previously known issue?

(Otherwise I've been really happy with 2.0 on this machine.)

Would "options AHC_NO_TAGS" be something worth trying?

NetBSD 2.0 MP kernel using MPBIOS
Dell Precision 420 Dual

	Thanks.

	- Scott

=== SCSI Errors ===

Jan 24 15:26:33 dirt /netbsd: ahc1:SCB 0xe - timed out
Jan 24 15:26:33 dirt /netbsd: >>>>>>>>>>>>>>>>>> Dump Card State Begins 
<<<<<<<<<<<<<<<<<
Jan 24 15:26:33 dirt /netbsd: ahc1: Dumping Card State in Command phase, at 
SEQADDR 0x173
Jan 24 15:26:33 dirt /netbsd: Card was paused
Jan 24 15:26:33 dirt /netbsd: ACCUM = 0x80, SINDEX = 0xa0, DINDEX = 0xe4, ARG_2 
= 0x3
Jan 24 15:26:33 dirt /netbsd: HCNT = 0x0 SCBPTR = 0x0
Jan 24 15:26:33 dirt /netbsd: SCSIPHASE[0x0] SCSISIGI[0x84] ERROR[0x0] 
SCSIBUSL[0xc0]
Jan 24 15:26:33 dirt /netbsd: LASTPHASE[0x80] SCSISEQ[0x12] SBLKCTL[0x6] 
SCSIRATE[0x18]
Jan 24 15:26:33 dirt /netbsd: SEQCTL[0x10] SEQ_FLAGS[0x0] SSTAT0[0x7] SSTAT1[0x0]
Jan 24 15:26:33 dirt /netbsd: SSTAT2[0x0] SSTAT3[0x0] SIMODE0[0x8] SIMODE1[0xac]
Jan 24 15:26:33 dirt /netbsd: SXFRCTL0[0x88] DFCNTRL[0x4] DFSTATUS[0x89]
Jan 24 15:26:33 dirt /netbsd: STACK: 0x34 0x0 0x16b 0x180
Jan 24 15:26:33 dirt /netbsd: SCB count = 16
Jan 24 15:26:33 dirt /netbsd: Kernel NEXTQSCB = 15
Jan 24 15:26:33 dirt /netbsd: Card NEXTQSCB = 15
Jan 24 15:26:33 dirt /netbsd: QINFIFO entries:
Jan 24 15:26:33 dirt /netbsd: Waiting Queue entries:
Jan 24 15:26:33 dirt /netbsd: Disconnected Queue entries:
Jan 24 15:26:33 dirt /netbsd: QOUTFIFO entries:
Jan 24 15:26:33 dirt /netbsd: Sequencer Free SCB List: 1 2 3 4 5 6 7 8 9 10 11 
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Jan 24 15:26:33 dirt /netbsd: Sequencer SCB Info:
Jan 24 15:26:33 dirt /netbsd:   0 SCB_CONTROL[0x40]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0x47] SCB_LUN[0x0] SCB_TAG[0xe]
Jan 24 15:26:33 dirt /netbsd:   1 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:   2 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:   3 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:   4 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:   5 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:   6 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:   7 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:   8 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:   9 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  10 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  11 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  12 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  13 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  14 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  15 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  16 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  17 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  18 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  19 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  20 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  21 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  22 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  23 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  24 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  25 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  26 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  27 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  28 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  29 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  30 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd:  31 SCB_CONTROL[0x0]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0xff] SCB_LUN[0xff] SCB_TAG[0xff]
Jan 24 15:26:33 dirt /netbsd: Pending list:
Jan 24 15:26:33 dirt /netbsd:  14 SCB_CONTROL[0x40]
Jan 24 15:26:33 dirt /netbsd: SCB_SCSIID[0x47] SCB_LUN[0x0]
Jan 24 15:26:33 dirt /netbsd: Kernel Free SCB list: 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Jan 24 15:26:33 dirt /netbsd: Untagged Q(4): 14
Jan 24 15:26:33 dirt /netbsd:
Jan 24 15:26:33 dirt /netbsd: <<<<<<<<<<<<<<<< Dump Card State Ends 
 >>>>>>>>>>>>>>>>>>

=== dmesg output ====

NetBSD 2.0 (SAAR.MP) #0: Thu Jan  6 14:41:56 PST 2005
         root@saar.tworoads.net:/usr/src/sys/arch/i386/compile/SAAR.MP
total memory = 255 MB
avail memory = 243 MB
BIOS32 rev. 0 found at 0xffe90
mainbus0 (root)
mainbus0: Intel MP Specification (Version 1.4) (DELL     WS 420      )
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel Pentium III (686-class), 864.51 MHz, id 0x686
cpu0: features 383fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu0: features 383fbff<PGE,MCA,CMOV,PAT,PSE36,MMX>
cpu0: features 383fbff<FXSR,SSE>
cpu0: I-cache 16 KB 32B/line 4-way, D-cache 16 KB 32B/line 4-way
cpu0: L2 cache 256 KB 32B/line 8-way
cpu0: ITLB 32 4 KB entries 4-way, 2 4 MB entries fully associative
cpu0: DTLB 64 4 KB entries 4-way, 8 4 MB entries 4-way
cpu0: calibrating local timer
cpu0: apic clock running at 132 MHz
cpu0: 8 page colors
cpu1 at mainbus0: apid 1 (application processor)
cpu1: starting
cpu1: Intel Pentium III (686-class), 864.46 MHz, id 0x686
cpu1: features 383fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu1: features 383fbff<PGE,MCA,CMOV,PAT,PSE36,MMX>
cpu1: features 383fbff<FXSR,SSE>
cpu1: I-cache 16 KB 32B/line 4-way, D-cache 16 KB 32B/line 4-way
cpu1: L2 cache 256 KB 32B/line 8-way
cpu1: ITLB 32 4 KB entries 4-way, 2 4 MB entries fully associative
cpu1: DTLB 64 4 KB entries 4-way, 8 4 MB entries 4-way
mpbios: bus 0 is type PCI
mpbios: bus 1 is type PCI
mpbios: bus 2 is type PCI
mpbios: bus 3 is type PCI
mpbios: bus 4 is type ISA
ioapic0 at mainbus0 apid 2 (I/O APIC)
ioapic0: pa 0xfec00000, version 20, 24 pins
ioapic0: misconfigured as apic 0
ioapic0: remapped to apic 2
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pchb0 at pci0 dev 0 function 0
pchb0: Intel 82840 Host (rev. 0x02)
pchb0: random number generator enabled
agp0 at pchb0: aperture at 0xf0000000, size 0x4000000
ppb0 at pci0 dev 1 function 0: Intel 82840 AGP (rev. 0x02)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
vga1 at pci1 dev 0 function 0: Nvidia Corporation Quadro2 (rev. 0xa4)
wsdisplay0 at vga1 kbdmux 1: console (80x25, vt100 emulation)
wsmux1: connecting to wsdisplay0
ppb1 at pci0 dev 30 function 0: Intel 82801AA Hub-to-PCI Bridge (rev. 0x02)
pci2 at ppb1 bus 2
pci2: i/o space, memory space enabled
ex0 at pci2 dev 4 function 0: 3Com 3c905C-TX 10/100 Ethernet with mngmt (rev. 0x78)
ex0: interrupting at ioapic0 pin 16 (irq 9)
ex0: MAC address 00:b0:d0:ab:aa:c6
bmtphy0 at ex0 phy 24: Broadcom 3c905C internal PHY, rev. 7
bmtphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
clcs0 at pci2 dev 6 function 0: Cirrus Logic CS4280 CrystalClear Audio Interface 
(rev. 0x01)
clcs0: interrupting at ioapic0 pin 18 (irq 10)
clcs0: ac97: Crystal CS4297A codec; headphone, 20 bit DAC, 18 bit ADC, Crystal 
Semi 3D
clcs0: ac97: ext id 200<AMAP>
audio0 at clcs0: full duplex, independent
ppb2 at pci2 dev 14 function 0: Digital Equipment DECchip 21152 PCI-PCI Bridge 
(rev. 0x03)
pci3 at ppb2 bus 3
pci3: i/o space, memory space enabled
ahc0 at pci3 dev 10 function 0: Adaptec aic7899 Ultra160 SCSI adapter
ahc0: interrupting at ioapic0 pin 18 (irq 10)
ahc0: aic7899: Ultra160 Wide Channel A, SCSI Id=7, 32/253 SCBs
scsibus0 at ahc0: 16 targets, 8 luns per target
ahc1 at pci3 dev 10 function 1: Adaptec aic7899 Ultra160 SCSI adapter
ahc1: interrupting at ioapic0 pin 19 (irq 11)
ahc1: aic7899: Ultra160 Wide Channel B, SCSI Id=7, 32/253 SCBs
scsibus1 at ahc1: 16 targets, 8 luns per target
pcib0 at pci0 dev 31 function 0
pcib0: Intel 82801AA LPC Interface Bridge (rev. 0x02)
piixide0 at pci0 dev 31 function 1
piixide0: Intel 82801AA IDE Controller (ICH) (rev. 0x02)
piixide0: bus-master DMA support present
piixide0: primary channel wired to compatibility mode
piixide0: primary channel interrupting at ioapic0 pin 14 (irq 14)
atabus0 at piixide0 channel 0
piixide0: secondary channel wired to compatibility mode
piixide0: secondary channel interrupting at ioapic0 pin 15 (irq 15)
atabus1 at piixide0 channel 1
uhci0 at pci0 dev 31 function 2: Intel 82801AA USB Controller (rev. 0x02)
uhci0: interrupting at ioapic0 pin 19 (irq 11)
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
Intel 82801AA SMBus Controller (SMBus serial bus, revision 0x02) at pci0 dev 31 
function 3 not configured
isa0 at pcib0
lpt0 at isa0 port 0x378-0x37b irq 7
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com1 at isa0 port 0x2f8-0x2ff irq 3: 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
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
isapnp0: no ISA Plug 'n Play devices found
ioapic0: enabling
fd0 at fdc0 drive 0: 1.44MB, 80 cyl, 2 head, 18 sec
Kernelized RAIDframe activated
scsibus0: waiting 2 seconds for devices to settle...
scsibus1: waiting 2 seconds for devices to settle...
wd0 at atabus0 drive 0: <MAXTOR 6L080L4>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 76345 MB, 155114 cyl, 16 head, 63 sec, 512 bytes/sect x 156355584 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133)
wd1 at atabus0 drive 1: <Maxtor 5T030H3>
wd1: drive supports 16-sector PIO transfers, LBA addressing
wd1: 29311 MB, 59554 cyl, 16 head, 63 sec, 512 bytes/sect x 60030432 sectors
wd1: 32-bit data port
wd1: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
wd0(piixide0:0:0): using PIO mode 4, Ultra-DMA mode 4 (Ultra/66) (using DMA data 
transfers)
wd1(piixide0:0:1): using PIO mode 4, Ultra-DMA mode 4 (Ultra/66) (using DMA data 
transfers)
atapibus0 at atabus1: 2 targets
cd0 at atapibus0 drive 0: <LG CD-RW CED-8120B, , 1.04> cdrom removable
cd0: 32-bit data port
cd0: drive supports PIO mode 4, DMA mode 2
cd0(piixide0:1:0): using PIO mode 4, DMA mode 2 (using DMA data transfers)
uhub1 at uhub0 port 2
uhub1: Texas Instruments TUSB2046 hub, class 9/0, rev 1.10/1.25, addr 2
uhub1: 4 ports with 4 removable, self powered
sd0 at scsibus0 target 0 lun 0: <FUJITSU, MAJ3091MP, 5508> disk fixed
sd0: 8683 MB, 13198 cyl, 3 head, 449 sec, 512 bytes/sect x 17783239 sectors
sd0: sync (12.50ns offset 127), 16-bit (160.000MB/s) transfers, tagged queueing
sd1 at scsibus0 target 1 lun 0: <FUJITSU, MAJ3091MP, 5508> disk fixed
sd1: 8683 MB, 13198 cyl, 3 head, 449 sec, 512 bytes/sect x 17783239 sectors
sd1: sync (12.50ns offset 127), 16-bit (160.000MB/s) transfers, tagged queueing
uplcom0 at uhub1 port 4
uplcom0: Prolific Technology PL2303 Serial adapter (ATEN/IOGEAR UC232A), rev 
1.10/2.02, addr 3
ucom0 at uplcom0
sd2 at scsibus1 target 3 lun 0: <iomega, jaz 1GB, J^77> disk removable
sd2: fabricating a geometry
sd2: 1021 MB, 1021 cyl, 64 head, 32 sec, 512 bytes/sect x 2091050 sectors
sd2: sync (100.00ns offset 15), 8-bit (10.000MB/s) transfers, tagged queueing
st0 at scsibus1 target 4 lun 0: <HP, C1537A, L005> tape removable
st0: density code 37, variable blocks, write-enabled
st0: sync (100.00ns offset 32), 8-bit (10.000MB/s) transfers
sd2: fabricating a geometry
sd2: fabricating a geometry
boot device: sd0
root on sd0a dumps on sd0b
root file system type: ffs
cpu1: CPU 1 running
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)