[RFC 03/34] dmaengine: virt-dma: add support for cyclic DMA periodic callbacks
Russell King - ARM Linux
linux at arm.linux.org.uk
Wed May 30 04:02:16 EDT 2012
On Wed, May 30, 2012 at 03:52:53PM +0800, Linus Walleij wrote:
> On Tue, May 29, 2012 at 5:36 PM, Russell King
> <rmk+kernel at arm.linux.org.uk> wrote:
>
> > Add support for cyclic DMA's periodic callbacks. Drivers are expected
> > to call vchan_cyclic_callback() when a period has completed, which will
> > schedule the tasklet to make the callback into the driver.
> >
> > As callbacks are made from tasklet context, it is important to realise
> > that we don't guarantee a callback for each completed period, but for
> > N completed periods where N may be greater than one.
>
> This last thing was something we have to fix right?
> Like for each driver to keep a counter of completed periods
> and call the handler repeatedly if N > 1.
No, I don't think we should do that - ALSA doesn't require it, and ALSA
is about the only user of this. As I've said, DMA engine drivers should
implement a correct tx_status function, which returns the remaining bytes
to be transferred to the end of the buffer so it's possible to find out
how many periods have completed when the callback is called.
More information about the linux-arm-kernel
mailing list