diff options
| author | Haitao Zhang <minipanda@linuxrobot.org> | 2011-12-31 22:30:06 -0500 |
|---|---|---|
| committer | Vinod Koul <vinod.koul@linux.intel.com> | 2012-01-06 01:01:56 -0500 |
| commit | f69f2e264f6388df6d3cae45dd67ddfd52aaa14b (patch) | |
| tree | 27c736df90bf30d31d69ec6e8263f3e26b869291 | |
| parent | e9f3a49c9698da6f6b606d5e048ddce308438763 (diff) | |
dma/imx-sdma: save irq flags when use spin_lock in sdma_tx_submit
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_unlock_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>
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
| -rw-r--r-- | drivers/dma/imx-sdma.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index f59fd8fffa88..a8af379680c1 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c | |||
| @@ -836,17 +836,18 @@ static struct sdma_channel *to_sdma_chan(struct dma_chan *chan) | |||
| 836 | 836 | ||
| 837 | static dma_cookie_t sdma_tx_submit(struct dma_async_tx_descriptor *tx) | 837 | static dma_cookie_t sdma_tx_submit(struct dma_async_tx_descriptor *tx) |
| 838 | { | 838 | { |
| 839 | unsigned long flags; | ||
| 839 | struct sdma_channel *sdmac = to_sdma_chan(tx->chan); | 840 | struct sdma_channel *sdmac = to_sdma_chan(tx->chan); |
| 840 | struct sdma_engine *sdma = sdmac->sdma; | 841 | struct sdma_engine *sdma = sdmac->sdma; |
| 841 | dma_cookie_t cookie; | 842 | dma_cookie_t cookie; |
| 842 | 843 | ||
| 843 | spin_lock_irq(&sdmac->lock); | 844 | spin_lock_irqsave(&sdmac->lock, flags); |
| 844 | 845 | ||
| 845 | cookie = sdma_assign_cookie(sdmac); | 846 | cookie = sdma_assign_cookie(sdmac); |
| 846 | 847 | ||
| 847 | sdma_enable_channel(sdma, sdmac->channel); | 848 | sdma_enable_channel(sdma, sdmac->channel); |
| 848 | 849 | ||
| 849 | spin_unlock_irq(&sdmac->lock); | 850 | spin_unlock_irqrestore(&sdmac->lock, flags); |
| 850 | 851 | ||
| 851 | return cookie; | 852 | return cookie; |
| 852 | } | 853 | } |
