aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/at_xdmac.c
diff options
context:
space:
mode:
authorCyrille Pitchen <cyrille.pitchen@atmel.com>2014-11-13 05:52:42 -0500
committerVinod Koul <vinod.koul@intel.com>2014-11-17 03:37:20 -0500
commit57819276db8ae06e231b884377b75860f267d984 (patch)
tree5ef3c0bd360f0390ba4d60895ae938ae19a80c22 /drivers/dma/at_xdmac.c
parent4e0978208d67730a316066911201a6252158d2fd (diff)
dmaengine: at_xdmac: fix a bug in transfer residue computation
The total size of the transfer was wrong in at_xdmac_prep_slave_sg() resulting in bad computation of the transfer residue by at_xdmac_tx_status(). Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/at_xdmac.c')
-rw-r--r--drivers/dma/at_xdmac.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
index fa9d75adf4d7..bf2aacbbf4cc 100644
--- a/drivers/dma/at_xdmac.c
+++ b/drivers/dma/at_xdmac.c
@@ -562,6 +562,7 @@ at_xdmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
562 struct scatterlist *sg; 562 struct scatterlist *sg;
563 int i; 563 int i;
564 u32 cfg; 564 u32 cfg;
565 unsigned int xfer_size = 0;
565 566
566 if (!sgl) 567 if (!sgl)
567 return NULL; 568 return NULL;
@@ -637,12 +638,13 @@ at_xdmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
637 dev_dbg(chan2dev(chan), "%s: add desc 0x%p to descs_list 0x%p\n", 638 dev_dbg(chan2dev(chan), "%s: add desc 0x%p to descs_list 0x%p\n",
638 __func__, desc, first); 639 __func__, desc, first);
639 list_add_tail(&desc->desc_node, &first->descs_list); 640 list_add_tail(&desc->desc_node, &first->descs_list);
641 xfer_size += len;
640 } 642 }
641 643
642 spin_unlock_bh(&atchan->lock); 644 spin_unlock_bh(&atchan->lock);
643 645
644 first->tx_dma_desc.flags = flags; 646 first->tx_dma_desc.flags = flags;
645 first->xfer_size = sg_len; 647 first->xfer_size = xfer_size;
646 first->direction = direction; 648 first->direction = direction;
647 649
648 return &first->tx_dma_desc; 650 return &first->tx_dma_desc;