starfive: add new target for StarFive JH7100/7110 SoC
[openwrt/staging/981213.git] / target / linux / starfive / patches-6.1 / 0113-dmaengine-dw-axi-dmac-Increase-polling-time-to-DMA-t.patch
1 From 92c2dc96af79b2f181cc97157ce3ef2be5b48f4c Mon Sep 17 00:00:00 2001
2 From: Walker Chen <walker.chen@starfivetech.com>
3 Date: Wed, 22 Mar 2023 17:48:19 +0800
4 Subject: [PATCH 113/122] dmaengine: dw-axi-dmac: Increase polling time to DMA
5 transmission completion status
6
7 The bit DMAC_CHEN[0] is automatically cleared by hardware to disable the
8 channel after the last AMBA transfer of the DMA transfer to the
9 destination has completed. Software can therefore poll this bit to
10 determine when this channel is free for a new DMA transfer.
11 This time requires at least 40 milliseconds on JH7110 SoC, otherwise an
12 error message 'failed to stop' will be reported.
13
14 Signed-off-by: Walker Chen <walker.chen@starfivetech.com>
15 ---
16 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19 --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
20 +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
21 @@ -1147,7 +1147,7 @@ static int dma_chan_terminate_all(struct
22 axi_chan_disable(chan);
23
24 ret = readl_poll_timeout_atomic(chan->chip->regs + DMAC_CHEN, val,
25 - !(val & chan_active), 1000, 10000);
26 + !(val & chan_active), 1000, 50000);
27 if (ret == -ETIMEDOUT)
28 dev_warn(dchan2dev(dchan),
29 "%s failed to stop\n", axi_chan_name(chan));