diff options
author | Ian Wisbon <ian.wisbon@timesys.com> | 2011-02-14 16:41:03 -0500 |
---|---|---|
committer | Ian Wisbon <ian.wisbon@timesys.com> | 2011-02-14 16:41:03 -0500 |
commit | 8a83780a187ba1961380814eaf9c503043345d12 (patch) | |
tree | 80f5d89cca49330e137688c72fb10c9f42dc5663 /arch/arm/plat-mxs/dmaengine.c | |
parent | 14a4057959f8ee0a2249eb2abd64fd6b1f571d98 (diff) |
Digi Release Code from del-5.6/main2.6.31-digi-201102141643
Diffstat (limited to 'arch/arm/plat-mxs/dmaengine.c')
-rw-r--r-- | arch/arm/plat-mxs/dmaengine.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/arch/arm/plat-mxs/dmaengine.c b/arch/arm/plat-mxs/dmaengine.c index 0c2485b18506..52330d3ea9e3 100644 --- a/arch/arm/plat-mxs/dmaengine.c +++ b/arch/arm/plat-mxs/dmaengine.c @@ -127,16 +127,14 @@ 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); @@ -153,11 +151,8 @@ 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); @@ -166,6 +161,7 @@ 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); |