summaryrefslogtreecommitdiffstats
path: root/drivers/dma/dw_dmac.c
diff options
context:
space:
mode:
authorViresh Kumar2011-03-03 11:17:17 +0100
committerVinod Koul2011-03-06 20:42:27 +0100
commit569432efa7975f5795efb8142134f5a098942381 (patch)
treea62ccafa3526a7da531b56d2a75c1bc21b3ff05c /drivers/dma/dw_dmac.c
parentdw_dmac: Move single descriptor from dwc->queue to dwc->active_list in dwc_co... (diff)
downloadkernel-qcow2-linux-569432efa7975f5795efb8142134f5a098942381.tar.gz
kernel-qcow2-linux-569432efa7975f5795efb8142134f5a098942381.tar.xz
kernel-qcow2-linux-569432efa7975f5795efb8142134f5a098942381.zip
dw_dmac: Calling dwc_scan_descriptors from dwc_tx_status() after taking lock
Lock must be taken before calling dwc_scan_descriptors, as this may access/modify shared data and queues. dwc_tx_status wasn't taking lock before calling this routine. This patch add code that takes lock before calling dwc_scan_descriptors. Signed-off-by: Viresh Kumar <viresh.kumar@st.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/dw_dmac.c')
-rw-r--r--drivers/dma/dw_dmac.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
index 942b50f57f21..2b0d5e99ae71 100644
--- a/drivers/dma/dw_dmac.c
+++ b/drivers/dma/dw_dmac.c
@@ -836,7 +836,9 @@ dwc_tx_status(struct dma_chan *chan,
ret = dma_async_is_complete(cookie, last_complete, last_used);
if (ret != DMA_SUCCESS) {
+ spin_lock_bh(&dwc->lock);
dwc_scan_descriptors(to_dw_dma(chan->device), dwc);
+ spin_unlock_bh(&dwc->lock);
last_complete = dwc->completed;
last_used = chan->cookie;