Re: [PATCH] DMA: let filter functions of of_dma_simple_xlate possible check of_node

Arnd Bergmann
2013-08-26T18:15:17Z

On Monday 26 August 2013 19:40:57 Vinod Koul wrote:
> Why does DT need the fliter function in the first place. The DT enabled drivers
> should not even have a filter function...
>
> The dmaengine core calls the optional filter function. This needs to be
> implemented in driver in order for driver to check if the channel is what it
> needs or not.

You only just merged the dma_get_slave_channel() patch, which allows having
no filter function. Up to Linux-3.11, the filter was always needed but
could be 'static' and only called by the xlate function. Now the xlate
function can pick a channel itself.

> And the selection should be done for the cases where you dont have programmable
> mux in dmac. For programmable ones passing slave_id in dma_slave_config should
> be fine.

I think passing a slave_id from the slave driver is never correct with DT,
since the ID is a property of the system rather than the slave device, so
the driver has no access to it. Drivers have to always take the settings
from DT and ignore what dma_slave_config() sets later.

Arnd