summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2010-09-09 13:15:11 +0800
committerHuang Shijie <b32955@freescale.com>2010-09-09 17:17:48 +0800
commitc68ef5cee2731d11ed32958aa77ae86c7120b603 (patch)
treeceb6188e2bf1b11227c7775868ed95cd6ae602c6
parentfcd3a416c29587d10ca125a801964c508ff72f96 (diff)
ENGR00127105 DMA:remove mutex when enable/disable DMA channel
These two functions can be called in IRQ context, but mutex may cause the schedule. So remove the mutex lock, the spinlock of each channel is enough. Signed-off-by: Huang Shijie <b32955@freescale.com>
-rw-r--r--arch/arm/plat-mxs/dmaengine.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/arm/plat-mxs/dmaengine.c b/arch/arm/plat-mxs/dmaengine.c
index 52330d3ea9e3..0c2485b18506 100644
--- a/arch/arm/plat-mxs/dmaengine.c
+++ b/arch/arm/plat-mxs/dmaengine.c
@@ -127,14 +127,16 @@ int mxs_dma_enable(int channel)
if (!(pchan->flags & MXS_DMA_FLAGS_ALLOCATED))
return -EINVAL;
+ /*
+ * neednot mutex lock, this function will be called in irq context.
+ * The mutex may cause process schedule.
+ */
pdma = pchan->dma;
- mutex_lock(&mxs_dma_mutex);
spin_lock_irqsave(&pchan->lock, flags);
if (pchan->pending_num && pdma->enable)
ret = pdma->enable(pchan, channel - pdma->chan_base);
pchan->flags |= MXS_DMA_FLAGS_BUSY;
spin_unlock_irqrestore(&pchan->lock, flags);
- mutex_unlock(&mxs_dma_mutex);
return ret;
}
EXPORT_SYMBOL(mxs_dma_enable);
@@ -151,8 +153,11 @@ void mxs_dma_disable(int channel)
return;
if (!(pchan->flags & MXS_DMA_FLAGS_BUSY))
return;
+ /*
+ * neednot mutex lock, this function will be called in irq context.
+ * The mutex may cause process schedule.
+ */
pdma = pchan->dma;
- mutex_lock(&mxs_dma_mutex);
spin_lock_irqsave(&pchan->lock, flags);
if (pdma->disable)
pdma->disable(pchan, channel - pdma->chan_base);
@@ -161,7 +166,6 @@ void mxs_dma_disable(int channel)
pchan->pending_num = 0;
list_splice_init(&pchan->active, &pchan->done);
spin_unlock_irqrestore(&pchan->lock, flags);
- mutex_unlock(&mxs_dma_mutex);
}
EXPORT_SYMBOL(mxs_dma_disable);