diff options
author | Samin Guo <samin.guo@starfivetech.com> | 2021-11-17 09:50:45 +0300 |
---|---|---|
committer | Emil Renner Berthing <emil.renner.berthing@canonical.com> | 2024-10-28 14:16:55 +0300 |
commit | 9f1d495e8d61e40939e0ebf8c115221bdbc27665 (patch) | |
tree | 05f95e020f448a1b55b3691a4e05d5b635ed5788 | |
parent | 44187ff9d39fa0c8dd84c8b0eb37fb51ca95ab7b (diff) | |
download | linux-9f1d495e8d61e40939e0ebf8c115221bdbc27665.tar.xz |
dmaengine: dw-axi-dmac: Handle xfer start while non-idle
Signed-off-by: Samin Guo <samin.guo@starfivetech.com>
Signed-off-by: Curry Zhang <curry.zhang@starfivetech.com>
-rw-r--r-- | drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 12 | ||||
-rw-r--r-- | drivers/dma/dw-axi-dmac/dw-axi-dmac.h | 1 |
2 files changed, 12 insertions, 1 deletions
diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c index fffafa86d964..7482b582e54a 100644 --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c @@ -428,11 +428,13 @@ static void axi_chan_block_xfer_start(struct axi_dma_chan *chan, u32 irq_mask; u8 lms = 0; /* Select AXI0 master for LLI fetching */ + chan->is_err = false; if (unlikely(axi_chan_is_hw_enable(chan))) { dev_err(chan2dev(chan), "%s is non-idle!\n", axi_chan_name(chan)); - return; + axi_chan_disable(chan); + chan->is_err = true; } axi_dma_enable(chan->chip); @@ -1074,6 +1076,14 @@ static noinline void axi_chan_handle_err(struct axi_dma_chan *chan, u32 status) axi_chan_name(chan)); goto out; } + if (chan->is_err) { + struct axi_dma_desc *desc = vd_to_axi_desc(vd); + + axi_chan_block_xfer_start(chan, desc); + chan->is_err = false; + goto out; + } + /* Remove the completed descriptor from issued list */ list_del(&vd->node); diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac.h b/drivers/dma/dw-axi-dmac/dw-axi-dmac.h index b842e6a8d90d..abf995ca84c9 100644 --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac.h +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac.h @@ -50,6 +50,7 @@ struct axi_dma_chan { struct dma_slave_config config; enum dma_transfer_direction direction; bool cyclic; + bool is_err; /* these other elements are all protected by vc.lock */ bool is_paused; }; |