Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: ti: k3-udma-glue: Configure the dma_dev for rings

Rings in RING mode should be using the DMA device for DMA API as in this
mode the ringacc will not access the ring memory in any ways, but the DMA
is.

Fix up the ring configuration and set the dma_dev unconditionally and let
the ringacc driver to select the correct device to use for DMA API.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Link: https://lore.kernel.org/r/20201208090440.31792-7-peter.ujfalusi@ti.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Peter Ujfalusi and committed by
Vinod Koul
d553e2ab aa8a4c4e

+8
+8
drivers/dma/ti/k3-udma-glue.c
··· 276 276 goto err; 277 277 } 278 278 279 + /* Set the dma_dev for the rings to be configured */ 280 + cfg->tx_cfg.dma_dev = k3_udma_glue_tx_get_dma_device(tx_chn); 281 + cfg->txcq_cfg.dma_dev = cfg->tx_cfg.dma_dev; 282 + 279 283 ret = k3_ringacc_ring_cfg(tx_chn->ringtx, &cfg->tx_cfg); 280 284 if (ret) { 281 285 dev_err(dev, "Failed to cfg ringtx %d\n", ret); ··· 594 590 dev_err(dev, "Failed to get RX/RXFDQ rings %d\n", ret); 595 591 goto err_rflow_put; 596 592 } 593 + 594 + /* Set the dma_dev for the rings to be configured */ 595 + flow_cfg->rx_cfg.dma_dev = k3_udma_glue_rx_get_dma_device(rx_chn); 596 + flow_cfg->rxfdq_cfg.dma_dev = flow_cfg->rx_cfg.dma_dev; 597 597 598 598 ret = k3_ringacc_ring_cfg(flow->ringrx, &flow_cfg->rx_cfg); 599 599 if (ret) {