Subject: Re: port-alpha/5546: port-alpha/lost a stack? exception_restore_regs bombs
To: Chris G. Demetriou <cgd@pa.dec.com>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: port-alpha
Date: 06/05/1998 17:43:05
On Fri, 05 Jun 1998 17:44:50 -0700 
 "Chris G. Demetriou" <cgd@pa.dec.com> wrote:

 > Oh, that reminds me:
 > 
 > is there any real locking on the extent/dma mapping code?  i haven't
 > looked to hard, but i don't see anything right off...  who's to keep
 > multiple requests (e.g. from a non-interrupt context and an interrupt
 > context) from losing?

In theory, this is handled by the caller of the bus_dma functions doing
their own necessary splbio()... and while network interrupts can come
into play here (except for the fact that there isn't yet any mbuf
sgmap foo; more on that topic from me later :-), all hardware interrupts
come in at the same level on the alpha...

However, real locking will have to be added... I will take a look at that
soon-ish.  LOCKDEBUG and simple_locks would definitely catch recursion.

 > I don't recall seeing anything like this in the docs, and it's not
 > clear that it 'works' to have the driver do the locking...

...well, the driver needs to splXXX .. but the code should probably do
an splimp() internally Just To Be Sure.  As for locking the dmamap, etc.,
yah, the guts need to do it.

Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                            Home: +1 408 866 1912
NAS: M/S 258-5                                       Work: +1 650 604 0935
Moffett Field, CA 94035                             Pager: +1 650 428 6939