mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 04:04:06 +00:00
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>
This commit is contained in:
parent
e045c0a44d
commit
55d5f5d828
2 changed files with 12 additions and 1 deletions
|
@ -377,11 +377,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);
|
||||
|
@ -1023,6 +1025,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);
|
||||
|
||||
|
|
|
@ -49,6 +49,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;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue