Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Aug 1997 09:30:20 -0700
From:      Amancio Hasty <hasty@rah.star-gate.com>
To:        Luigi Rizzo <luigi@labinfo.iet.unipi.it>
Cc:        smp@csn.net, multimedia@FreeBSD.ORG, hackers@FreeBSD.ORG
Subject:   Re: isa_dmastatus 
Message-ID:  <199708181630.JAA04190@rah.star-gate.com>
In-Reply-To: Your message of "Mon, 18 Aug 1997 12:51:31 %2B0200." <199708181051.MAA10185@labinfo.iet.unipi.it> 

next in thread | previous in thread | raw e-mail | index | archive | help
>From The Desk Of Luigi Rizzo :
> > Lets see,
> > 
> > If a driver uses auto dma, it generally calls isa_dmastart once.
> > isa_dmastart sets the busy flag:
> > 
> > from isa_dmastart:
> > 	dma_busy |= (1 << chan);
> > 
> > When we get a dma interrupt from the device, if I call isa_dmadone to
> > clear the busy flag it does not mean that I am  done using the
> > buffer and I can't call isa_dmastart because the dma processes
> > is still active. 
> > 
> > So if we wish to support auto dma and use the existing dma interface
> > in isa.c then I suggest that we add a simple check in the isa 
> > dma routine to bypass the busy flag check when we are using 
> > auto dma. What does this mean in an SMP environment I have no 
> 
> right.
> 
> > idea because when a driver requests auto dma in essence he is 
> > requesting exclusive access of the dma channel.
> 
> In fact I doubt ISA DMA channels can be shared since from the hw point
> of view they work as IRQ lines (i.e. active high). It is true that some
> peripherals have sw-programmable DMA lines (and IRQ as well) so in
> principle one could deactivate (i.e. put in Hi-Z) the DMA line and let
> someone else use it, but I doubt any of our driver does that right now.
> 
> As for isa_dmadone, I am under the impression that the function is
> overloaded right now, because it serves to call the bounce-buffer code
> when necessary, and not just to mark the DMA channel as idle.
> 
> Moreover there are bigger problems with DMA in automode since when you
> do a write using bounce buffers you need to invoke isa_dmastart every
> time, not just the first one.
> 
> So in the end, I think that our isa_dma routines probably do not work
> with auto mode _and_ bounce buffers, indipendently of the checks on the
> dma_busy/dma_inuse flags.
> 
> We can temporarily bypass the problem by making the DMA routines fail
> if auto mode is requested and a bounce buffer needs to be used for the
> channel.

Your analisys is good. Whats left now, provided that the rest of the
team agrees on your proposed solution, is who is going to write
the code and when?

And Please post the revised code for peer review.

	Thank You,
	Amancio






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708181630.JAA04190>