(Optional?) DMA vs. PIO
Lars-Peter Clausen
lars at metafoo.de
Thu Oct 8 17:42:03 CEST 2020
On 10/8/20 5:05 PM, Andy Shevchenko wrote:
> Hi!
>
> During internal review of one patch I have been puzzled with the following code
> and Pierre suggested to ask mailing list for help.
>
> My main concern is what was the idea behind? Does it mean we support optional
> DMA in such case? If now, why not to return an error code directly?
>
> ---8<---8<---8<---
>
>> Why ASoC core has the following code in the first place:
>>
>> 387 chan = dma_request_chan(dev, name);
>> 388 if (IS_ERR(chan)) {
>> 389 if (PTR_ERR(chan) == -EPROBE_DEFER)
>> 390 return -EPROBE_DEFER;
>> 391 pcm->chan[i] = NULL;
>> 392 } else {
>> 393 pcm->chan[i] = chan;
>> 394 }
>>
>> (note lines 389-391).
>> If PIO fallback is not okay, why not to return an error there?
> no idea, the code has been this way since 2013
> (5eda87b890f867b098e5566b5543642851e8b9c3)
>
> It's worth asking the question on the mailing list, I don't know if this is a
> bug or a feature.
>
This is to handle the case where a only TX or only RX is supported. In
that case it is not an error if only one DMA channel is specified.
More information about the Alsa-devel
mailing list