Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316650
b: refs/heads/master
c: 4a46ba3
h: refs/heads/master
v: v3
  • Loading branch information
Laxman Dewangan authored and Vinod Koul committed Jul 13, 2012
1 parent fc0a3ac commit 3e7be71
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 46fb3f8ef5bde1325b1e58867a3a98dd746511d7
refs/heads/master: 4a46ba36e25dcff1d30eb1681135c3c10af71c16
15 changes: 9 additions & 6 deletions trunk/drivers/dma/tegra20-apb-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,7 @@ static enum dma_status tegra_dma_tx_status(struct dma_chan *dc,
struct tegra_dma_sg_req *sg_req;
enum dma_status ret;
unsigned long flags;
unsigned int residual;

spin_lock_irqsave(&tdc->lock, flags);

Expand All @@ -744,9 +745,10 @@ static enum dma_status tegra_dma_tx_status(struct dma_chan *dc,
/* Check on wait_ack desc status */
list_for_each_entry(dma_desc, &tdc->free_dma_desc, node) {
if (dma_desc->txd.cookie == cookie) {
dma_set_residue(txstate,
dma_desc->bytes_requested -
dma_desc->bytes_transferred);
residual = dma_desc->bytes_requested -
(dma_desc->bytes_transferred %
dma_desc->bytes_requested);
dma_set_residue(txstate, residual);
ret = dma_desc->dma_status;
spin_unlock_irqrestore(&tdc->lock, flags);
return ret;
Expand All @@ -757,9 +759,10 @@ static enum dma_status tegra_dma_tx_status(struct dma_chan *dc,
list_for_each_entry(sg_req, &tdc->pending_sg_req, node) {
dma_desc = sg_req->dma_desc;
if (dma_desc->txd.cookie == cookie) {
dma_set_residue(txstate,
dma_desc->bytes_requested -
dma_desc->bytes_transferred);
residual = dma_desc->bytes_requested -
(dma_desc->bytes_transferred %
dma_desc->bytes_requested);
dma_set_residue(txstate, residual);
ret = dma_desc->dma_status;
spin_unlock_irqrestore(&tdc->lock, flags);
return ret;
Expand Down

0 comments on commit 3e7be71

Please sign in to comment.