Date: Fri, 22 Aug 1997 07:19:57 +0200 (MET DST) From: Luigi Rizzo <luigi@labinfo.iet.unipi.it> To: hasty@rah.star-gate.com (Amancio Hasty) Cc: multimedia@FreeBSD.ORG Subject: Re: [snd] For your review: isa.c Message-ID: <199708220519.HAA15088@labinfo.iet.unipi.it> In-Reply-To: <199708220122.SAA00395@rah.star-gate.com> from "Amancio Hasty" at Aug 21, 97 06:21:42 pm
next in thread | previous in thread | raw e-mail | index | archive | help
About the old vs. new isa.c: my original isa_dmadone, although it works in most cases, is very buggy: * it cannot handle situations where the counter changes while reading the dma registers; * it uses splhigh() whereas it should use disable_intr() to block interrupts; * it uselessly reads the data pointer register. As a temporary fix for supporting auto mode, I second amancio's approach of using the variable dma_auto_mode to mark the state of the channel when using auto mode. Probably it could be a good idea to check, upon the call to isa_dmastart, that the address passed to the channel is compatible with the operating mode (i.e. is below 16M when auto mode is used) and return an error otherwise. Since the test (a call to isa_dmarangecheck() ) is already there, one could just add a test within that conditional block (and then either return an error message, or panic). I also would like that the code had a big warning on the fact that auto-mode does not work with bounce buffers. E.g. something like /* * For use a dma channel in normal mode, you should call * the following routines: * * isa_dma_acquire() first, to register the use of the channel; * isa_dmastart()/isa_dmadone on each transfer. Both calls * are necessary to let the bounce buffer mechanism work. * isa_dma_release() to unregister the use of the channel. * * For AUTO mode, you need to call isa_dmastart() only once, and * isa_dmadone() when operation is complete. WARNING: bounce * buffers are not supported in auto mode. * */ Cheers Luigi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708220519.HAA15088>