aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/fsl-edma.c
diff options
context:
space:
mode:
authorStefan Agner <stefan@agner.ch>2014-11-13 12:56:02 +0100
committerVinod Koul <vinod.koul@intel.com>2014-12-08 18:43:44 +0530
commit6ab55b214c625f4d56199f7ebd0b419f43f23bb2 (patch)
tree9e39cfa4e87e89e9f68be04702b3eb261b76f742 /drivers/dma/fsl-edma.c
parentdrivers/dma/pch_dma: declare pch_dma_id_table as static (diff)
downloadlinux-dev-6ab55b214c625f4d56199f7ebd0b419f43f23bb2.tar.xz
linux-dev-6ab55b214c625f4d56199f7ebd0b419f43f23bb2.zip
dmaengine: fsl-edma: fix calculation of remaining bytes
If the current transfer control descriptor (TCD) was not yet started, the address will be the same as the initial address. Hence test if the current address is less than or equal to the start address of each TCD. Signed-off-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/fsl-edma.c')
-rw-r--r--drivers/dma/fsl-edma.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma/fsl-edma.c b/drivers/dma/fsl-edma.c
index 3c5711d5fe97..58c6fc7e902e 100644
--- a/drivers/dma/fsl-edma.c
+++ b/drivers/dma/fsl-edma.c
@@ -386,7 +386,7 @@ static size_t fsl_edma_desc_residue(struct fsl_edma_chan *fsl_chan,
&(edesc->tcd[i].vtcd->daddr));
len -= size;
- if (cur_addr > dma_addr && cur_addr < dma_addr + size) {
+ if (cur_addr >= dma_addr && cur_addr < dma_addr + size) {
len += dma_addr + size - cur_addr;
break;
}