mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
dmaengine: mediatek: do not issue a new desc if one is still current
[ Upstream commit 2537b40b0a4f61d2c83900744fe89b09076be9c6 ] Avoid issuing a new desc if one is still being processed as this can lead to some desc never being marked as completed. Signed-off-by: Guillaume Ranquet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
3d995587c3
commit
f7b1926c7c
1 changed files with 12 additions and 8 deletions
|
|
@ -204,14 +204,9 @@ static void mtk_uart_apdma_start_rx(struct mtk_chan *c)
|
|||
|
||||
static void mtk_uart_apdma_tx_handler(struct mtk_chan *c)
|
||||
{
|
||||
struct mtk_uart_apdma_desc *d = c->desc;
|
||||
|
||||
mtk_uart_apdma_write(c, VFF_INT_FLAG, VFF_TX_INT_CLR_B);
|
||||
mtk_uart_apdma_write(c, VFF_INT_EN, VFF_INT_EN_CLR_B);
|
||||
mtk_uart_apdma_write(c, VFF_EN, VFF_EN_CLR_B);
|
||||
|
||||
list_del(&d->vd.node);
|
||||
vchan_cookie_complete(&d->vd);
|
||||
}
|
||||
|
||||
static void mtk_uart_apdma_rx_handler(struct mtk_chan *c)
|
||||
|
|
@ -242,9 +237,17 @@ static void mtk_uart_apdma_rx_handler(struct mtk_chan *c)
|
|||
|
||||
c->rx_status = d->avail_len - cnt;
|
||||
mtk_uart_apdma_write(c, VFF_RPT, wg);
|
||||
}
|
||||
|
||||
list_del(&d->vd.node);
|
||||
vchan_cookie_complete(&d->vd);
|
||||
static void mtk_uart_apdma_chan_complete_handler(struct mtk_chan *c)
|
||||
{
|
||||
struct mtk_uart_apdma_desc *d = c->desc;
|
||||
|
||||
if (d) {
|
||||
list_del(&d->vd.node);
|
||||
vchan_cookie_complete(&d->vd);
|
||||
c->desc = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static irqreturn_t mtk_uart_apdma_irq_handler(int irq, void *dev_id)
|
||||
|
|
@ -258,6 +261,7 @@ static irqreturn_t mtk_uart_apdma_irq_handler(int irq, void *dev_id)
|
|||
mtk_uart_apdma_rx_handler(c);
|
||||
else if (c->dir == DMA_MEM_TO_DEV)
|
||||
mtk_uart_apdma_tx_handler(c);
|
||||
mtk_uart_apdma_chan_complete_handler(c);
|
||||
spin_unlock_irqrestore(&c->vc.lock, flags);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
|
|
@ -363,7 +367,7 @@ static void mtk_uart_apdma_issue_pending(struct dma_chan *chan)
|
|||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&c->vc.lock, flags);
|
||||
if (vchan_issue_pending(&c->vc)) {
|
||||
if (vchan_issue_pending(&c->vc) && !c->desc) {
|
||||
vd = vchan_next_desc(&c->vc);
|
||||
c->desc = to_mtk_uart_apdma_desc(&vd->tx);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue