On Mon, Oct 12, 2020 at 07:26:04PM +0100, Mark Brown wrote: > On Mon, Oct 12, 2020 at 07:31:47PM +0300, Andy Shevchenko wrote: > > On Mon, Oct 12, 2020 at 04:48:03PM +0100, Mark Brown wrote: > > > On Mon, Oct 12, 2020 at 04:55:27PM +0300, Andy Shevchenko wrote: > > > > > if (ret != DMA mode ok) > > > > ret = try PIO mode; > > > > > which makes OF dependent parts gone along with relying on the properties rather > > > > than real resource availability. > > > > I don't understand the blocker to writing that code at the minute? > > > Return code in both cases DMA okay, DMA is not okay is 0. > > Ah, right - we don't really expose the resulting component to the > drivers. Although we don't appear to have any drivers doing the open > coding you suggest? The active use case we have is for drivers > (currently only the STM32 SAI AFAICT) that always do DMA but only do one > direction (not half duplex, a single direction on a given DAI). They > don't want to fall back to PIO, they want to know which channel is > valid. It's not just a DMA/no DMA question, it's also which of the DMA > channels are valid. Looking into them I think all of the cases are requiring DMA to work. At least one channel. Seems no one is designed for optional DMA performance. The problem here is they are checking for properties (meta-data) rather than resources (data) to be available. But since they will fail sooner or later it doesn't make big difference. % git grep -n dma-names -- sound/soc/ | cut -f1 -d: | sort -u sound/soc/adi/axi-i2s.c sound/soc/atmel/atmel-i2s.c sound/soc/stm/stm32_sai_sub.c sound/soc/tegra/tegra210_admaif.c sound/soc/ti/davinci-mcasp.c axi-i2s: Checks for channels to see if capture / playback are supposed to be working, but AFAICS tries without actually checking the resources availability. snd_soc_dai_init_dma_data(dai, i2s->has_playback ? &i2s->playback_dma_data : NULL, i2s->has_capture ? &i2s->capture_dma_data : NULL); atmel-i2s: Checks for half-duplex channel, but registers unconditionally. snd_soc_dai_init_dma_data(dai, &dev->playback, &dev->capture); tegra210_admaif: Checks for Tx to be always present. Custom DAI probe that simply assigns data structure pointers. davinchi-mcasp: Checks for names to be present Custom DAI probe that simply assigns data structure pointers. -- With Best Regards, Andy Shevchenko