提交 7746ab0a 编写于 作者: I Ilya Yanok 提交者: David S. Miller

davinci-cpdma: fix locking issue in cpdma_chan_stop

Free the channel lock before calling __cpdma_chan_process to prevent
dead lock.
Signed-off-by: NIlya Yanok <yanok@emcraft.com>
Tested-by: NAmeya Palande <2ameya@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2692ba61
...@@ -836,11 +836,13 @@ int cpdma_chan_stop(struct cpdma_chan *chan) ...@@ -836,11 +836,13 @@ int cpdma_chan_stop(struct cpdma_chan *chan)
chan_write(chan, cp, CPDMA_TEARDOWN_VALUE); chan_write(chan, cp, CPDMA_TEARDOWN_VALUE);
/* handle completed packets */ /* handle completed packets */
spin_unlock_irqrestore(&chan->lock, flags);
do { do {
ret = __cpdma_chan_process(chan); ret = __cpdma_chan_process(chan);
if (ret < 0) if (ret < 0)
break; break;
} while ((ret & CPDMA_DESC_TD_COMPLETE) == 0); } while ((ret & CPDMA_DESC_TD_COMPLETE) == 0);
spin_lock_irqsave(&chan->lock, flags);
/* remaining packets haven't been tx/rx'ed, clean them up */ /* remaining packets haven't been tx/rx'ed, clean them up */
while (chan->head) { while (chan->head) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册