Commit dda36f98 authored by Nicolas Ferre's avatar Nicolas Ferre Committed by Dan Williams

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: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 568f7f0c
......@@ -853,11 +853,11 @@ static void atc_issue_pending(struct dma_chan *chan)
dev_vdbg(chan2dev(chan), "issue_pending\n");
if (!atc_chan_is_enabled(atchan)) {
spin_lock_bh(&atchan->lock);
if (!atc_chan_is_enabled(atchan)) {
atc_advance_work(atchan);
spin_unlock_bh(&atchan->lock);
}
spin_unlock_bh(&atchan->lock);
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment