On Fri, Oct 09, 2020 at 01:27:51PM +0300, Andy Shevchenko wrote:
On Thu, Oct 08, 2020 at 05:11:05PM +0100, Mark Brown wrote:
We intentionally do not return an error if we get a permanent failure from dma_request_chan() in order to support systems which have TX only or RX only channels. Add a comment documenting this.
--- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -386,6 +386,11 @@ static int dmaengine_pcm_request_chan_of(struct dmaengine_pcm *pcm, name = config->chan_names[i]; chan = dma_request_chan(dev, name); if (IS_ERR(chan)) {
/*
* Only report probe deferral errors, channels
* might not be present for devices that
* support only TX or only RX.
*/ if (PTR_ERR(chan) == -EPROBE_DEFER) return -EPROBE_DEFER; pcm->chan[i] = NULL;
Now I would like to continue discussion from this point.
What is the best way for individual ASoC drivers to be sure that at load time they have or have not DMA resources available?
Now, seems the approach is to check dma-names property present and thus, try to switch to DMA mode, otherwise PIO. But this seems to me a bit fragile. Why ASoC core can't simple recognize DMA resources as optional (for the drivers that want to know if they available or not)?