*BSD News Article 27453


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!ihnp4.ucsd.edu!sdd.hp.com!vixen.cso.uiuc.edu!howland.reston.ans.net!pipex!sunic!aun.uninett.no!trane.uninett.no!ugle.unit.no!idt.unit.no!jarle
From: jarle@idt.unit.no (Jarle Greipsland)
Newsgroups: comp.os.386bsd.development
Subject: Re: Device Driver interrupt call problem
Date: 16 Feb 94 19:10:34
Organization: Free Hardware Foundation, UnLtd.
Lines: 31
Message-ID: <JARLE.94Feb16191034@drue.idt.unit.no>
References: <2jte7hINN7tr@uwm.edu>
NNTP-Posting-Host: drue.idt.unit.no
In-reply-to: bk@csd4.csd.uwm.edu's message of 16 Feb 1994 15:30:57 GMT

In article <2jte7hINN7tr@uwm.edu>, bk@csd4.csd.uwm.edu (Robert Joseph Knier) writes:

bk> I have a wierd problem - I am working on a device driver for Future
bk> Domain 950 / ST01/ST02 SCSI cards for use with Julian's SCSI code.
bk> Currently I am working on the reselection phase of the SCSI bus.  At
bk> interrupt time, I handle the request and call a upper level function the
bk> handle buffer clean up.  The problem is that when I try to call the upper
bk> level function, I get a vm fault and the kernel panics.  The panic happens
bk> at the function call (I never make it to the upper level function).  This
bk> upper level function is in another file.  I have unsuccessfully tried to
bk> The call I am trying to make looks like: 
bk>	void scisi_done(struct buf *xs).   

You're sure that it isn't something ala this one:
		xs->when_done(xs->done_arg, xs->done_arg2); ?

If this is the one you're thinking of you should put a test for when_done
being NULL before you do the call (And no, you don't call through a NULL
pointer :-).  xs->when_done may be NULL under some circumstances, most
notably during initialization when you're supposed to run without
interrupts.  If you're running without interrupts the command should not be
queued in the normal way in your lower level driver.  Instead you must
complete the command and return e.g. COMPLETE or HAD_ERROR.

(Disclaimer: All this is for NetBSD-current, I don't remember if this
applies to the original 386bsd.)

					-jarle
----
"Quantum particles: the dreams that stuff is made of."
				-- David Moser