Subject: kern/14527: scsi bus reset while probing devices on ahc(4) after SCSI_DELAY
To: None <gnats-bugs@gnats.netbsd.org>
From: None <mauzi@expertlan.hu>
List: netbsd-bugs
Date: 11/10/2001 11:23:46
>Number:         14527
>Category:       kern
>Synopsis:       scsi bus reset while probing devices on ahc(4) after SCSI_DELAY
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 10 11:25:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Gergely EGERVARY
>Release:        NetBSD-1.5Y and 1.5.2
>Organization:
ExpertLAN Corp
>Environment:
NetBSD aquarius.poli.hu 1.5Y NetBSD 1.5Y (AQUARIUS) #45: Sat Nov 10 19:37:14 CET 2001     root@aquarius.poli.hu:/usr/home/usr.src/sys/arch/i386/compile/AQUARIUS i386
>Description:
SCSI bus reset should occur at boot time _before_ waiting for SCSI_DELAY, but it seems to happen while probing the first scsi device on the bus

I have tried it on 1.5.2 and the latest 1.5Y with an Adaptec 2940AU (aic7860) and an Adaptec 2940UW (aic7880)
>How-To-Repeat:
get an Adaptec card mentioned above, and try it :)

my full dmesg output:

----
NetBSD 1.5Y (AQUARIUS) #45: Sat Nov 10 19:37:14 CET 2001
    root@aquarius.poli.hu:/usr/home/usr.src/sys/arch/i386/compile/AQUARIUS
cpu0: Intel Pentium III (Coppermine) Celeron (686-class), 801.86 MHz
cpu0: I-cache 16 KB 32b/line 4-way, D-cache 16 KB 32b/line 2-way
cpu0: L2 cache 128 KB 32b/line 4-way
cpu0: features 383f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR>
cpu0: features 383f9ff<PGE,MCA,CMOV,FGPAT,PSE36,MMX,FXSR,SSE>
total memory = 255 MB
avail memory = 231 MB
using 4096 buffers containing 16384 KB of memory
BIOS32 rev. 0 found at 0xfb4f0
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: Intel 82443BX Host Bridge/Controller (rev. 0x03)
agp0 at pchb0: aperture at 0xd0000000, size 0x4000000
ppb0 at pci0 dev 1 function 0: Intel 82443BX AGP Interface (rev. 0x03)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
vga1 at pci1 dev 0 function 0: Matrox MGA G400 AGP (rev. 0x03)
wsdisplay0 at vga1 kbdmux -1: console (80x25, vt100 emulation)
pcib0 at pci0 dev 7 function 0pcib0: Intel 82371AB PCI-to-ISA Bridge (PIIX4) (rev. 0x02)
pciide0 at pci0 dev 7 function 1: Intel 82371AB IDE controller (PIIX4) (rev. 0x01)
pciide0: bus-master DMA support present
pciide0: primary channel wired to compatibility mode
wd0 at pciide0 channel 0 drive 0: <QUANTUM FIREBALLlct20 20>
wd0: drive supports 8-sector PIO transfers, LBA addressing
wd0: 19470 MB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 39876480 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
pciide0: primary channel interrupting at irq 14
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA data transfers)
pciide0: secondary channel wired to compatibility mode
pciide0: secondary channel ignored (disabled)
Intel 82371AB USB Host Controller (PIIX4) (USB serial bus, revision 0x01) at pci 0 dev 7 function 2 not configured
Intel 82371AB Power Management Controller (PIIX4) (miscellaneous bridge, revision 0x02) at pci0 dev 7 function 3 not configured
emuxki0 at pci0 dev 11 function 0: Creative Labs SBLive! EMU 10000 (audio multimedia, revision 0x08)
emuxki0: interrupting at irq 5
emuxki0: TriTech unknown codec; no 3D stereo
audio0 at emuxki0: full duplex, mmap, independent
Creative Labs PCI Gameport Joystick (miscellaneous input, revision 0x08) at pci0 dev 11 function 1 not configured
ahc0 at pci0 dev 13 function 0
ahc0: interrupting at irq 15
ahc0: aic7880 Wide Channel A, SCSI Id=7, 16/255 SCBs
scsibus0 at ahc0: 16 targets, 8 luns per target
epic0 at pci0 dev 15 function 0: SMC 83c170 Fast Ethernet, rev. 9
epic0: interrupting at irq 11
epic0: SMC9432TX_1, Ethernet address 00:e0:29:74:4b:ba
ukphy0 at epic0 phy 3: Generic IEEE 802.3u media interface
ukphy0: AC101 10/100 media interface (OUI 0x0010a9, model 0x0021), rev. 11
ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
isa0 at pcib0
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
pmsi0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pmsi0 mux 0
lpt0 at isa0 port 0x378-0x37b irq 7
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
fd0 at fdc0 drive 0: 1.44MB, 80 cyl, 2 head, 18 sec
isapnp0: no ISA Plug 'n Play devices found
apm0 at mainbus0: Power Management spec V1.2
biomask e745 netmask ef45 ttymask ffc7
scsibus0: waiting 15 seconds for devices to settle...
cd0 at scsibus0 target 0 lun 0: <YAMAHA, CRW8824S, 1.0a> SCSI2 5/cdrom removable
cd0: async, 8-bit transfers

---- the bus reset happens here

cd1 at scsibus0 target 1 lun 0: <YAMAHA, CRW8824S, 1.0a> SCSI2 5/cdrom removable
cd1: async, 8-bit transfers
cd2 at scsibus0 target 2 lun 0: <IBM, CDRM00103\134000\134000\134000\134000\134000!I, 1.0g> SCSI2 5/cdrom removable
cd2: async, 8-bit transfers
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
IP Filter: v3.4.16 initialized.  Default = pass all, Logging = enabled
epic0: lost carrier
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
>Fix:
I have hacked scsiconf.c to do a bus reset before waiting SCSI_DELAY. it works fine for me, but I think it's not the right place to do the reset, probably the driver should do the reset when initialised.
(how is it done with other controllers?)

>Release-Note:
>Audit-Trail:
>Unformatted: