Date: Sun, 17 Aug 1997 19:48:53 -0700 From: Amancio Hasty <hasty@rah.star-gate.com> To: Michael Smith <msmith@atrad.adelaide.edu.au> Cc: hackers@FreeBSD.ORG Subject: Re: isa_dmastop... (fwd) Message-ID: <199708180248.TAA02547@rah.star-gate.com> In-Reply-To: Your message of "Mon, 18 Aug 1997 11:05:37 %2B0930." <199708180135.LAA08486@genesis.atrad.adelaide.edu.au>
next in thread | previous in thread | raw e-mail | index | archive | help
My first reaction. I am not too keen on having printfs in the dma handling routines. The routine should return an error code. > if (dma_inuse & (1 << chan) == 0) > printf("isa_dmastop: channel %d not acquired\n", chan); This condition can be met easily by calling isa_dma_acquire;however, the printf is *not* a good idea. --- > if (dma_busy & (1 << chan) == 0) > printf("isa_dmastop: channel %d not acquired\n", chan); Same thing with respect to the printf. Now with respect to the sound driver and the use of auto dma, it appears to me that once we start doing auto dma the busy flag gets on the way because we don't clear the busy flag by calling isa_dmadone. For auto dma , isa_dmastart gets called once which right now it sets the busy flag however since I don't call isa_dmastart again to initiate a dma transfer I don't see the point of calling isa_dmadone . Currently, the sound drivers allocate memory below the 16MB memory region so we dont use bounce buffers. If you want to keep the sanity checks then I suggest that you bracket at least the busy flag check by way of checking to see if the channel is operating in auto dma mode and I will be more than happy to modify the guspnp driver to call isa_dma_acquire. So if the above strategy is applied to isa_dmastatus and to isa_dmastop we will all be a very happy family. Tnks, Amancio >From The Desk Of Michael Smith : > > Ok, to avoid any further agony about ISA DMA, here's a request I've had > just recently from Luigi. This looks OK to me, but again it contains the > sanity checking that Amancio was unhappy about; folks, how do you feel? > > ----- Forwarded message from Luigi Rizzo ----- > > >From luigi@labinfo.iet.unipi.it Sat Aug 9 23:27:10 1997 > From: Luigi Rizzo <luigi@labinfo.iet.unipi.it> > Message-Id: <199708091246.OAA01564@labinfo.iet.unipi.it> > Subject: isa_dmastop... > To: msmith@gsoft.com.au > Date: Sat, 9 Aug 1997 14:46:19 +0200 (MET DST) > X-Mailer: ELM [version 2.4 PL23] > Content-Type: text > > For the sound driver to implement pause/abort, the following function > is useful (one can do things without it if tolerates some "channel > busy" messages from the kernel...) If you like it, can you commit to > isa.c ? > > Thanks > Luigi > /* > * this stops the dma channel and returns the residual count > * derived calling isa_dmastatus > */ > int isa_dmastop(int chan) > { > if (dma_inuse & (1 << chan) == 0) > printf("isa_dmastop: channel %d not acquired\n", chan); > if (dma_busy & (1 << chan) == 0) > printf("isa_dmastop: channel %d not acquired\n", chan); > if ((chan & 4) == 0) > outb(DMA1_SMSK, (chan & 3) | 4 /* disable mask */); > else > outb(DMA2_SMSK, (chan & 3) | 4 /* disable mask */); > return isa_dmastatus(chan); > } > > > ----- End of forwarded message from Luigi Rizzo ----- > > -- > ]] Mike Smith, Software Engineer msmith@gsoft.com.au [[ > ]] Genesis Software genesis@gsoft.com.au [[ > ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ > ]] realtime instrument control. (ph) +61-8-8267-3493 [[ > ]] Unix hardware collector. "Where are your PEZ?" The Tick [[ >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708180248.TAA02547>