Subject: kern/21842: Adaptec AHA-284x VLB broken in NetBSD-1.6T.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <fredb@immanent.net>
List: netbsd-bugs
Date: 06/10/2003 14:19:43
>Number:         21842
>Category:       kern
>Synopsis:       Adaptec AHA-284x VLB broken in NetBSD-1.6T.
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 10 19:20:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Frederick Bruckman
>Release:        NetBSD 1.6T
>Organization:
>Environment:
>Description:
	
	Recent changes to the "ahc" driver broke AHA-284x VLB. Here's
	dmesg from a failed attempt, preceded by a successful boot of
	NetBSD 1.6Q. Notice that after

	ahc0: ahc_init_scbdata - Unable to allocate initial scbs

	no scsibus is configured, and therefore no root device is
	found:


NetBSD 1.6Q (DESPAIR) #0: Sat Mar 29 14:10:18 CST 2003
	fredb@ilfxv013.immanent.net:/usr/home/fredb/scratch/obj/s/src/sys/arch/i
386/compile/DESPAIR
total memory = 65148 KB
avail memory = 57596 KB
using 839 buffers containing 3356 KB of memory
mainbus0 (root)
cpu0 at mainbus0: (uniprocessor)
cpu0: Intel 486DX4 (486-class), id 0x480
cpu0: features 3<FPU,VME>
isa0 at mainbus0
ahc0 at isa0 port 0x1c00-0x1cff irq 11: Adaptec AHA-284x SCSI (BIOS enabled)
ahc0: aic7770 >= Rev E, Single Channel A, SCSI Id=7, 4/255 SCBs
scsibus0 at ahc0: 8 targets, 8 luns per target
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com0: console
[snip]
scsibus0: waiting 2 seconds for devices to settle...
sd0 at scsibus0 target 0 lun 0: <CONNER, CFP1080S, 4649> disk fixed
sd0: 1030 MB, 3658 cyl, 6 head, 96 sec, 512 bytes/sect x 2110812 sectors
sd0: sync (100.0ns offset 15), 8-bit (10.000MB/s) transfers, tagged queueing
sd1 at scsibus0 target 1 lun 0: <CONNER, CFP1080S, 4443> disk fixed
sd1: 1030 MB, 3658 cyl, 6 head, 96 sec, 512 bytes/sect x 2110812 sectors
sd1: sync (100.0ns offset 15), 8-bit (10.000MB/s) transfers, tagged queueing
warning: double match for boot device (sd0, sd1)
boot device: sd0
root on sd0a dumps on sd0b
root file system type: ffs
[snip]
syncing disks... 2 2 done
rebooting...
NetBSD 1.6T (DESPAIR) #1: Tue Jun 10 09:55:59 CDT 2003
	fredb@rapture.immanent.net:/usr/obj/sys/arch/i386/compile/DESPAIR
total memory = 65148 KB
avail memory = 57404 KB
using 839 buffers containing 3356 KB of memory
mainbus0 (root)
cpu0 at mainbus0: (uniprocessor)
cpu0: Intel 486DX4 (486-class), id 0x480
cpu0: features 3<FPU,VME>
isa0 at mainbus0
ahc0 at isa0 port 0x1c00-0x1cff irq 11: Adaptec AHA-284x SCSI (BIOS enabled)
ahc0: aic7770 >= Rev E, ahc0: ahc_init_scbdata - Unable to allocate initial
scbs
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com0: console
[snip]
boot device: <unknown>
root device: sd0a
use one of: raid0[a-p] raid1[a-p] raid2[a-p] raid3[a-p] wd0[a-p] we0 fd0[a-p]
fd1[a-p] ddb halt reboot
root device: reboot
syncing disks... done
rebooting...


	With the GENERIC_DIAGNOSTIC kernel, it panics at that point.
	Here's a console log, complete with stack trace:


\> boot netbsd-GENERIC_DIAGNOSTIC -s
booting hd0a:netbsd-GENERIC_DIAGNOSTIC (howto 0x2)
6082164+127816+402408 [341728+291122]=0x6e9fd8
BIOS CFG: Model-SubM-Rev: fc-01-00, 0x70<KBDINT,RTC,IC2>
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 1.6T (GENERIC_DIAGNOSTIC) #1: Tue Jun 10 08:49:46 CDT 2003
       
fredb@rapture.immanent.net:/usr/obj/sys/arch/i386/compile/GENERIC_DIAGNO
STIC
total memory = 65148 KB
avail memory = 53188 KB
using 839 buffers containing 3356 KB of memory
mainbus0 (root)
cpu0 at mainbus0: (uniprocessor)
cpu0: Intel 486DX4 (486-class), id 0x480
cpu0: features 3<FPU,VME>
isa0 at mainbus0
ahc0 at isa0 port 0x1c00-0x1cff irq 11: Adaptec AHA-284x SCSI (BIOS enabled)
ahc0: aic7770 >= Rev E, panic: _bus_dmamem_unmap
Stopped in pid 0.1 (swapper) at netbsd:cpu_Debugger+0x4:        leave
db\> bt
cpu_Debugger(c096bc00,c06dee60,deadbeef,c0395c79,0) at netbsd:cpu_Debugger+0x4
panic(c0584160,1000000,1000,0,c096bc00) at netbsd:panic+0xb8
_bus_dmamem_unmap(c06dee60,deadbeef,deadbeef,c03a3093,c096bc00) at
netbsd:_bus_d
mamem_unmap+0x2c
_bus_dma_free_bouncebuf(c06dee60,c096be00,11c,e,c096be00) at
netbsd:_bus_dma_fre
e_bouncebuf+0x33
_bus_dmamap_destroy(c06dee60,c096be00,11c,c07eea7c,c0966000) at
netbsd:_bus_dmam
ap_destroy+0x23
_bus_dmamap_create(c06dee60,ffffff,20,10000,0) at
netbsd:_bus_dmamap_create+0x14
b
ahc_alloc_scbs(c093d400,c0536add,1,c01ab673,c093d400) at
netbsd:ahc_alloc_scbs+0
x138
ahc_init_scbdata(c093d400,c0536bed,c07eeb50,c0328e19,c093d400) at
netbsd:ahc_ini
t_scbdata+0x1b6
ahc_init(c093d400,c093d41c,c0537ca9,2,c093d41c) at netbsd:ahc_init+0x197
ahc_aic77xx_attach(c093d400,1,c07eebe0,c0496b4b,c093d400) at
netbsd:ahc_aic77xx_
attach+0x161
ahc_isa_attach(c0940d00,c093d400,c07eecb4,c0322f59,c093d400) at
netbsd:ahc_isa_a
ttach+0x24b
config_attach(c0940d00,c06d17cc,c07eecb4,c045fd10,c07eed4c) at
netbsd:config_att
ach+0x341
isasearch(c0940d00,c06d17cc,0,279,c06d17cc) at netbsd:isasearch+0xeb
mapply(c07eed4c,c06d17cc,c07eed50,c0328e51,c06df720) at netbsd:mapply+0x20
config_search(c045ff1c,c0940d00,0,c0322bef,c06d390c) at
netbsd:config_search+0x9
4
isaattach(c0963fc0,c0940d00,c06df720,c0322f59,c0940d00) at
netbsd:isaattach+0xa4

config_attach(c0963fc0,c06d2c94,c06df720,c03d7b7c,c0963fc0) at
netbsd:config_att
ach+0x341
config_found_sm(c0963fc0,c06df720,c03d7b7c,0,c06d390c) at
netbsd:config_found_sm
+0x2f
mainbus_attach(0,c0963fc0,0,c0322f59,c0963fc0) at netbsd:mainbus_attach+0x164
config_attach(0,c06d271c,0,0,9) at netbsd:config_attach+0x341
config_rootfound(c058516a,0,c07eef60,c03a6a39,c06d8dc0) at
netbsd:config_rootfou
nd+0x3f
cpu_configure(9,c0732420,c07eefa0,c0304d64,c0732420) at
netbsd:cpu_configure+0x2
4
configure(c07ea010,7ea000,7f3000,0,0) at netbsd:configure+0x4a
main(0,0,0,0,0) at netbsd:main+0x2c8
db\>


>How-To-Repeat:
	
	"ahc" works fine on my PCI dual MP system. It's possibly only
	broken for Vesa Local Bus. 
>Fix:
	
	Last known, working kernel is 1.6Q.


>Release-Note:
>Audit-Trail:
>Unformatted:
 	
 System: NetBSD despair.immanent.net 1.6Q NetBSD 1.6Q (DESPAIR) #0: Sat Mar 29 14:10:18 CST 2003
 fredb@ilfxv013.immanent.net:/usr/home/fredb/scratch/obj/s/src/sys/arch/i386/compile/DESPAIR i386
 Architecture: i386
 Machine: i386
 (Problem occurs on 1.6T, which is therefore unbootable on this host.)