From: Russell King - ARM Linux Date: Mon, 3 Jan 2011 22:32:05 +0000 (+0000) Subject: ARM: PL08x: fix missed spin-unlock in pl08x_issue_pending() X-Git-Tag: firefly_0821_release~7613^2~2671^2~11^2~42 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9c0bb43bbd02fba0b235f8993d1f175734fa8735;p=firefly-linux-kernel-4.4.55.git ARM: PL08x: fix missed spin-unlock in pl08x_issue_pending() pl08x_issue_pending() returns with the spinlock locked and interrupts disabled if the channel is waiting for a physical DMA to become free. This is wrong - especially as pl08x_issue_pending() is an API function as it leads to deadlocks. Fix it to always return with the spinlock unlocked. Signed-off-by: Russell King Acked-by: Linus Walleij Signed-off-by: Dan Williams --- diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index b3b3180ce561..9a8d44504c6a 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -1294,15 +1294,11 @@ static void pl08x_issue_pending(struct dma_chan *chan) unsigned long flags; spin_lock_irqsave(&plchan->lock, flags); - /* Something is already active */ - if (plchan->at) { - spin_unlock_irqrestore(&plchan->lock, flags); - return; - } - - /* Didn't get a physical channel so waiting for it ... */ - if (plchan->state == PL08X_CHAN_WAITING) + /* Something is already active, or we're waiting for a channel... */ + if (plchan->at || plchan->state == PL08X_CHAN_WAITING) { + spin_unlock_irqrestore(&plchan->lock, flags); return; + } /* Take the first element in the queue and execute it */ if (!list_empty(&plchan->desc_list)) {