Cyclic DMA - callback properties and tx_status residue

Russell King - ARM Linux linux at arm.linux.org.uk
Fri May 11 10:07:10 EDT 2012


On Thu, May 10, 2012 at 04:31:15PM +0530, Vinod Koul wrote:
> This should not be in ASoC library. The driver should be able to detect
> if a tasklet was called for many dma completions and notify the client
> (soc-lib) accordingly.

No.  Think about the cyclic case.  How do you correctly record how many
'periods' have completed so that when your tasklet eventually gets called,
you call its callback the correct number of times?

I think that's totally pointless and wasteful too from the ALSA core code
point of view - all the ALSA cares about is that "some periods have
completed" and ALSA will then ask the low level driver where the DMA is,
and update things according to the current DMA position.

It is my opinion that having this emulation of the current position in
soc-dmaengine-pcm is not only causing a wrong direction to be taken here,
but is potentially causing inefficiency by forcing conditions into the API
which we really don't need.

> One way to do this would be to ensure that the descriptor is marked in
> irq_handler and then all descriptor completed notified in tasklet.

No.  You're assuming that for each IRQ you have the tasklet run exactly
once.  There is no such guarantee.



More information about the linux-arm-kernel mailing list