dmaengine: xilinx_dma: In dma channel probe fix node order dependency
authorRadhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Thu, 30 Jan 2020 12:54:25 +0000 (18:24 +0530)
committerVinod Koul <vkoul@kernel.org>
Tue, 25 Feb 2020 05:47:54 +0000 (11:17 +0530)
commit14ccf0aab46e1888e2f45b6e995c621c70b32651
treef9be156e2d0c52ec72c4e218d1c9fb4db6c624a2
parent04c2bc2bede12f768227ac2b62b21258dc6b45e8
dmaengine: xilinx_dma: In dma channel probe fix node order dependency

In overlay application we noticed that dma channel node probe order is
inverted i.e s2mm channel is probed first followed by mm2s channel. The
reason for this inversion is fdtoverlay utility which uses a function
called fdt_add_subnode(*). It stores the subnodes after the properties,
this has the effect of inserting the new subnode before any others and
the end result is a reversal.

Because of this inverted channel probe order, the node probed first is
assigned a '0' index instead of Channel ID should be '0' for tx and '1'
for rx and dmatest client using the DT convention fails in dma transfer
as channel are swapped.

To fix above behavior and make channel assignment index independent
of probe order, always assign mm2s channel at '0' index and the s2mm
channel at IP specific fixed offset derived from the max_channels
count.

Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Link: https://lore.kernel.org/r/1580388865-9960-3-git-send-email-radhey.shyam.pandey@xilinx.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/xilinx/xilinx_dma.c