diff options
| author | Koichiro Den <den@valinux.co.jp> | 2026-08-21 02:34:32 +0900 |
|---|---|---|
| committer | Vinod Koul <vkoul@kernel.org> | 2026-09-09 19:06:51 +0530 |
| commit | 770792d7b8ef767a389fc386d7f0103828b34be4 (patch) | |
| tree | 04ce0d69013e7fa77b11f46b78665519dd3dc3ba | |
| parent | 3d50c87cead7c0181a6c766c1434036715d87efa (diff) | |
| download | linux-next-770792d7b8ef767a389fc386d7f0103828b34be4.tar.gz linux-next-770792d7b8ef767a389fc386d7f0103828b34be4.zip | |
dmaengine: dw-edma: Factor out linked-list transfer start
Move linked-list programming into dw_edma_core_ll_start(). It can derive
the first-batch state from desc->start_burst, so dw_edma_core_start() no
longer needs a pass-through argument.
No functional change.
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Koichiro Den <den@valinux.co.jp>
Link: https://patch.msgid.link/20260820173439.2004068-4-den@valinux.co.jp
Signed-off-by: Vinod Koul <vkoul@kernel.org>
| -rw-r--r-- | drivers/dma/dw-edma/dw-edma-core.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/drivers/dma/dw-edma/dw-edma-core.c b/drivers/dma/dw-edma/dw-edma-core.c index 03b2c2188351..a6bb68ffdfe2 100644 --- a/drivers/dma/dw-edma/dw-edma-core.c +++ b/drivers/dma/dw-edma/dw-edma-core.c @@ -67,17 +67,11 @@ static void vchan_free_desc(struct virt_dma_desc *vdesc) kfree(vd2dw_edma_desc(vdesc)); } -static void dw_edma_core_start(struct dw_edma_desc *desc, bool first) +static void dw_edma_core_ll_start(struct dw_edma_desc *desc) { struct dw_edma_chan *chan = desc->chan; - size_t i = 0; - - if (chan->non_ll) { - chan->dw->core->non_ll_start(chan, &desc->burst[desc->start_burst]); - desc->done_burst = desc->start_burst; - desc->start_burst += 1; - return; - } + size_t i; + bool first = !desc->start_burst; for (i = 0; i + desc->start_burst < desc->nburst; i++) { u32 idx = i + desc->start_burst; @@ -101,6 +95,21 @@ static void dw_edma_core_start(struct dw_edma_desc *desc, bool first) dw_edma_core_ch_doorbell(chan); } +static void dw_edma_core_start(struct dw_edma_desc *desc) +{ + struct dw_edma_chan *chan = desc->chan; + + if (chan->non_ll) { + chan->dw->core->non_ll_start(chan, + &desc->burst[desc->start_burst]); + desc->done_burst = desc->start_burst; + desc->start_burst += 1; + return; + } + + dw_edma_core_ll_start(desc); +} + static int dw_edma_start_transfer(struct dw_edma_chan *chan) { struct dw_edma_desc *desc; @@ -114,7 +123,7 @@ static int dw_edma_start_transfer(struct dw_edma_chan *chan) if (!desc) return 0; - dw_edma_core_start(desc, !desc->start_burst); + dw_edma_core_start(desc); desc->cb = !desc->cb; |
