Commit de135939 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Vinod Koul

dmaengine: edma: Check the current decriptor first in tx_status()

It's likely that the caller investigates the status of a currently
active descriptor. Make that simple check first and only rumage in the
vchan list if that fails.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarJoel Fernandes <joelf@ti.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent b6205c39
...@@ -852,11 +852,10 @@ static enum dma_status edma_tx_status(struct dma_chan *chan, ...@@ -852,11 +852,10 @@ static enum dma_status edma_tx_status(struct dma_chan *chan,
return ret; return ret;
spin_lock_irqsave(&echan->vchan.lock, flags); spin_lock_irqsave(&echan->vchan.lock, flags);
vdesc = vchan_find_desc(&echan->vchan, cookie); if (echan->edesc && echan->edesc->vdesc.tx.cookie == cookie)
if (vdesc)
txstate->residue = to_edma_desc(&vdesc->tx)->residue;
else if (echan->edesc && echan->edesc->vdesc.tx.cookie == cookie)
txstate->residue = echan->edesc->residue; txstate->residue = echan->edesc->residue;
else if ((vdesc = vchan_find_desc(&echan->vchan, cookie)))
txstate->residue = to_edma_desc(&vdesc->tx)->residue;
spin_unlock_irqrestore(&echan->vchan.lock, flags); spin_unlock_irqrestore(&echan->vchan.lock, flags);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment