[alsa-devel] [PATCH] ASoC: dmaengine_pcm: Make FLAG_NO_RESIDUE internal

Lars-Peter Clausen lars at metafoo.de
Mon Apr 27 21:22:43 CEST 2015


On 04/27/2015 08:28 PM, Mark Brown wrote:
> On Mon, Apr 27, 2015 at 12:44:25PM +0200, Lars-Peter Clausen wrote:
[...]
>> This patch makes the FLAG_NO_RESIDUE internal and no longer allows audio
>> controller drivers to manually set the flag. If a DMA driver against
>> expectations does not support reporting its capabilities for now the generic
>> DMAengine PCM driver will now emit a warning and simply assume that residue
>> reporting is not supported. In the future this might be changed to aborting
>> with an error.
>
> I'm not sure it's ever going to buy us anything to error out on stuff,
> it's not like the no residue case doesn't need to be supported anyway
> for controllers that just can't do it.

I'm not too sure about it either. Since it is prone to race-conditions by 
design we'd ideally eventually drop support for the fallback period counting 
mechanism in the PCM driver altogether and instead the period counting would 
be done at the DMAengine layer. At the DMAengine layer the period counting 
can usually be implemented without any race conditions and other DMAengine 
clients will also benefit from it.

A good start might be to emit a warning when we have to do this in the PCM 
driver to at least make sure that new platforms do this properly.

- Lars



More information about the Alsa-devel mailing list