aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaitao Zhang <minipanda@linuxrobot.org>2011-10-21 13:23:16 +0800
committerEric Miao <eric.miao@linaro.org>2011-10-22 08:29:10 +0800
commit78b86052c5e36ba18b70f4b2ea6f518a2c9dbc1d (patch)
tree411ca7ce48b6b5c20522ef19d963b90a3400b20b
parent1113eabb4155cd6d5745ec316ad5ebcb7d0b394f (diff)
downloadlinux-linaro-78b86052c5e36ba18b70f4b2ea6f518a2c9dbc1d.tar.gz
SAUCE: mx53_loco: fix deadlock report from sdma_tx_submit() during boot
BugLink: http://bugs.launchpad.net/bugs/878701 Adjust to use spin_lock_irqsave()/spin_lock_irqresotre(), so to make it safe when called from interrupt context. Signed-off-by: Haitao Zhang <haitao.zhang@linaro.org> Signed-off-by: Eric Miao <eric.miao@linaro.org>
-rw-r--r--drivers/dma/imx-sdma.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 330e2e54ada..884dfcd2903 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -818,17 +818,18 @@ static struct sdma_channel *to_sdma_chan(struct dma_chan *chan)
static dma_cookie_t sdma_tx_submit(struct dma_async_tx_descriptor *tx)
{
+ unsigned long flags;
struct sdma_channel *sdmac = to_sdma_chan(tx->chan);
struct sdma_engine *sdma = sdmac->sdma;
dma_cookie_t cookie;
- spin_lock_irq(&sdmac->lock);
+ spin_lock_irqsave(&sdmac->lock, flags);
cookie = sdma_assign_cookie(sdmac);
sdma_enable_channel(sdma, sdmac->channel);
- spin_unlock_irq(&sdmac->lock);
+ spin_unlock_irqrestore(&sdmac->lock, flags);
return cookie;
}