Skip to content

Commit

Permalink
dmaengine: at_hdmac: fix race while monitoring channel status
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolas Ferre authored and djbw committed Jan 15, 2011
1 parent 568f7f0 commit dda36f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/dma/at_hdmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit dda36f9

Please sign in to comment.