From owner-freebsd-multimedia Mon Aug 18 05:00:44 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id FAA16783 for multimedia-outgoing; Mon, 18 Aug 1997 05:00:44 -0700 (PDT) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id FAA16735; Mon, 18 Aug 1997 05:00:30 -0700 (PDT) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id MAA10185; Mon, 18 Aug 1997 12:51:31 +0200 From: Luigi Rizzo Message-Id: <199708181051.MAA10185@labinfo.iet.unipi.it> Subject: Re: isa_dmastatus To: hasty@rah.star-gate.com (Amancio Hasty) Date: Mon, 18 Aug 1997 12:51:31 +0200 (MET DST) Cc: smp@csn.net, multimedia@FreeBSD.ORG, hackers@FreeBSD.ORG In-Reply-To: <199708180723.AAA00439@rah.star-gate.com> from "Amancio Hasty" at Aug 18, 97 00:23:25 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-multimedia@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > 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/ _____________________________|______________________________________