Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Aug 1997 12:51:31 +0200 (MET DST)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        hasty@rah.star-gate.com (Amancio Hasty)
Cc:        smp@csn.net, multimedia@FreeBSD.ORG, hackers@FreeBSD.ORG
Subject:   Re: isa_dmastatus
Message-ID:  <199708181051.MAA10185@labinfo.iet.unipi.it>
In-Reply-To: <199708180723.AAA00439@rah.star-gate.com> from "Amancio Hasty" at Aug 18, 97 00:23:25 am

next in thread | previous in thread | raw e-mail | index | archive | help
> 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.

	Cheers
	Luigi
-----------------------------+--------------------------------------
Luigi Rizzo                  |  Dip. di Ingegneria dell'Informazione
email: luigi@iet.unipi.it    |  Universita' di Pisa
tel: +39-50-568533           |  via Diotisalvi 2, 56126 PISA (Italy)
fax: +39-50-568522           |  http://www.iet.unipi.it/~luigi/
_____________________________|______________________________________



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