Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7746ab0a authored by Ilya Yanok's avatar Ilya Yanok Committed by David S. Miller
Browse files

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: default avatarIlya Yanok <yanok@emcraft.com>
Tested-by: default avatarAmeya Palande <2ameya@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2692ba61
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -836,11 +836,13 @@ int cpdma_chan_stop(struct cpdma_chan *chan)
	chan_write(chan, cp, CPDMA_TEARDOWN_VALUE);

	/* handle completed packets */
	spin_unlock_irqrestore(&chan->lock, flags);
	do {
		ret = __cpdma_chan_process(chan);
		if (ret < 0)
			break;
	} while ((ret & CPDMA_DESC_TD_COMPLETE) == 0);
	spin_lock_irqsave(&chan->lock, flags);

	/* remaining packets haven't been tx/rx'ed, clean them up */
	while (chan->head) {