aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorNicolas Ferre <nicolas.ferre@atmel.com>2011-01-12 09:39:10 -0500
committerDan Williams <dan.j.williams@intel.com>2011-01-14 19:54:44 -0500
commitdda36f9821321edf65d69da5c0807df7e73d26fc (patch)
tree2a629da4c1650c11bb0b1783317fbda0a1799ec6 /drivers/dma
parent568f7f0c2e597671d3e646e0b85c95c4a5756fef (diff)
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/dma')
-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)
853 853
854 dev_vdbg(chan2dev(chan), "issue_pending\n"); 854 dev_vdbg(chan2dev(chan), "issue_pending\n");
855 855
856 spin_lock_bh(&atchan->lock);
856 if (!atc_chan_is_enabled(atchan)) { 857 if (!atc_chan_is_enabled(atchan)) {
857 spin_lock_bh(&atchan->lock);
858 atc_advance_work(atchan); 858 atc_advance_work(atchan);
859 spin_unlock_bh(&atchan->lock);
860 } 859 }
860 spin_unlock_bh(&atchan->lock);
861} 861}
862 862
863/** 863/**