diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2014-04-28 15:19:51 -0400 |
|---|---|---|
| committer | Vinod Koul <vinod.koul@intel.com> | 2014-04-30 01:02:15 -0400 |
| commit | de135939716dcdc8a6ea62e9228feb2eec0fca11 (patch) | |
| tree | af4c1aec22c4e52377ea47cdb88ba4da62d3577e | |
| parent | b6205c39011e52e2f7983c3dba01ee51524ae29c (diff) | |
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: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Joel Fernandes <joelf@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
| -rw-r--r-- | drivers/dma/edma.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c index 30cbbde52364..cfc267e819eb 100644 --- a/drivers/dma/edma.c +++ b/drivers/dma/edma.c | |||
| @@ -852,11 +852,10 @@ static enum dma_status edma_tx_status(struct dma_chan *chan, | |||
| 852 | return ret; | 852 | return ret; |
| 853 | 853 | ||
| 854 | spin_lock_irqsave(&echan->vchan.lock, flags); | 854 | spin_lock_irqsave(&echan->vchan.lock, flags); |
| 855 | vdesc = vchan_find_desc(&echan->vchan, cookie); | 855 | if (echan->edesc && echan->edesc->vdesc.tx.cookie == cookie) |
| 856 | if (vdesc) | ||
| 857 | txstate->residue = to_edma_desc(&vdesc->tx)->residue; | ||
| 858 | else if (echan->edesc && echan->edesc->vdesc.tx.cookie == cookie) | ||
| 859 | txstate->residue = echan->edesc->residue; | 856 | txstate->residue = echan->edesc->residue; |
| 857 | else if ((vdesc = vchan_find_desc(&echan->vchan, cookie))) | ||
| 858 | txstate->residue = to_edma_desc(&vdesc->tx)->residue; | ||
| 860 | spin_unlock_irqrestore(&echan->vchan.lock, flags); | 859 | spin_unlock_irqrestore(&echan->vchan.lock, flags); |
| 861 | 860 | ||
| 862 | return ret; | 861 | return ret; |
