summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNicolas Ferre <nicolas.ferre@atmel.com>2011-01-12 15:39:10 +0100
committerDan Williams <dan.j.williams@intel.com>2011-01-14 16:54:44 -0800
commitdda36f9821321edf65d69da5c0807df7e73d26fc (patch)
tree2a629da4c1650c11bb0b1783317fbda0a1799ec6 /drivers
parent568f7f0c2e597671d3e646e0b85c95c4a5756fef (diff)
downloadlinux-dda36f9821321edf65d69da5c0807df7e73d26fc.tar.bz2
dmaengine: at_hdmac: fix race while monitoring channel status
We were reading channel status then taking a lock. This lead to a race because this lock may delay us and then make this channel not idle anymore. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dma/at_hdmac.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 3938db210834..40f2bf4ae474 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -853,11 +853,11 @@ static void atc_issue_pending(struct dma_chan *chan)
dev_vdbg(chan2dev(chan), "issue_pending\n");
+ spin_lock_bh(&atchan->lock);
if (!atc_chan_is_enabled(atchan)) {
- spin_lock_bh(&atchan->lock);
atc_advance_work(atchan);
- spin_unlock_bh(&atchan->lock);
}
+ spin_unlock_bh(&atchan->lock);
}
/**