]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dma: ti: k3-udma: Fix ring_idx to pair k3 nav rings
authorUdit Kumar <u-kumar1@ti.com>
Wed, 21 Feb 2024 14:23:44 +0000 (19:53 +0530)
committerTom Rini <trini@konsulko.com>
Mon, 4 Mar 2024 18:41:04 +0000 (13:41 -0500)
ring_idx was not correctly assigned in case of tflow_id is zero.
Which leads to wrong pairing of DMA for drivers like OSPI.

Fixes: 4312a1dfca26 ("dma: ti: k3-udma: Use ring_idx to pair k3 nav rings")
Reviewed-by: Jai Luthra <j-luthra@ti.com>
Signed-off-by: Udit Kumar <u-kumar1@ti.com>
drivers/dma/ti/k3-udma.c

index ed0a9bf487afef53f480217451e2d1fc5b7d1df1..ef3074aa13ff3107c2faf53d3d671670fe46e1eb 100644 (file)
@@ -884,10 +884,10 @@ static int udma_alloc_tx_resources(struct udma_chan *uc)
                return ret;
 
        tchan = uc->tchan;
-       if (tchan->tflow_id >= 0)
+       if (tchan->tflow_id > 0)
                ring_idx = tchan->tflow_id;
        else
-               ring_idx = ud->bchan_cnt + tchan->id;
+               ring_idx = tchan->id;
 
        ret = k3_nav_ringacc_request_rings_pair(ud->ringacc, ring_idx, -1,
                                                &uc->tchan->t_ring,