Subject: port-amiga/1409: New sbic.c driver still chokes on unhandled condition
To: None <gnats-bugs@gnats.netbsd.org>
From: Ignatios Souvatzis <is@beverly.rhein.de>
List: netbsd-bugs
Date: 08/27/1995 12:19:21
>Number:         1409
>Category:       port-amiga
>Synopsis:       new sbic.c hangs on unhandled condition.
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 27 06:35:00 1995
>Last-Modified:
>Originator:     Ignatios Souvatzis
>Organization:
	Oberdollendorfer Hackerstube
>Release:        19950821, with sbic.c,v 1.15 1995/08/24 15:46:19
>Environment:
	
System: NetBSD beverly 1.0A NetBSD 1.0A (BEVERLY) #164: Tue Aug 22 15:30:09 MET DST 1995 is@beverly:/usr/src/sys/arch/amiga/compile/BEVERLY amiga


>Description:

	After a short period of normal activity, the system hangs,
	finally falling into the Debugger with:

	sbicwait TIMEO @972 asr=x20 csr=xff

	The asr code is: no data ready, no parity error, no command in 
	progress, not level II command busy, last command ignored (a 
	command was issued by the host just prior or concurrent with a 
	pending interrupt, and therefore the command will be ignored),
	no interrupt pending.

	"trace" says (modulo typos; I really need a polaroid + scanner
	for this work):

	Debugger(95e32, 20, ff, 1000)+6
	sbicwait(2e50041, c0, 0, 3cc, 1011)+5c
	sbicselectbus(53f400, 2e50041, 0, 0, 0)+f0
	sbicgo(53f400, 57d780)+aa
	sbic_sched(53f400, 1b, 80,80,1b)+148
	sbicnextstate(53f400, 1b, 80)+29a
	sbicintr(53f400, 8, 53f424, 5a3300, dd1ecc)+58
	ahsc_dmaintr(53f400)+64
	intrhand(2200)+64
	lev2intr(?)
	mi_switch(...)
	tsleep(...)
	getblk(...)
	bread(...)
	ffs_update(...)
	ffs_fsync(...)
	ffs_sync(...)
	sync(...)
	syscall(...)
	trap0(...)


>How-To-Repeat:
	Build kernel, boot it, log in, start screen... what? it still works?
>Fix:
	I don't have the time to look at the code closely at the moment (I'm
	moving), but it looks like the interrupt status (csr register) wasn't
	read out before issuing the last command, or the LCI status wasn't
	checked after issuing the last command.
>Audit-Trail:
>Unformatted:
Ignatios Souvatzis