From: Martin Fuzzey Date: Thu, 26 Mar 2009 21:27:52 +0000 (+0100) Subject: mxc : BUG in imx_dma_request X-Git-Tag: v3.12-rc1~14332^2~29^2~63 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f2292532a5f0cf6359adca349cdd2a0150581937;p=kernel%2Fkernel-generic.git mxc : BUG in imx_dma_request On MX2 platforms imx_dma_request() calls request_irq() which may sleep with interrupts disabled. Signed-off-by: Martin Fuzzey Signed-off-by: Sascha Hauer --- diff --git a/arch/arm/plat-mxc/dma-mx1-mx2.c b/arch/arm/plat-mxc/dma-mx1-mx2.c index a9126ed..7764643 100644 --- a/arch/arm/plat-mxc/dma-mx1-mx2.c +++ b/arch/arm/plat-mxc/dma-mx1-mx2.c @@ -693,12 +693,15 @@ int imx_dma_request(int channel, const char *name) local_irq_restore(flags); return -EBUSY; } + memset(imxdma, 0, sizeof(imxdma)); + imxdma->name = name; + local_irq_restore(flags); /* request_irq() can block */ #ifdef CONFIG_ARCH_MX2 ret = request_irq(MXC_INT_DMACH0 + channel, dma_irq_handler, 0, "DMA", NULL); if (ret) { - local_irq_restore(flags); + imxdma->name = NULL; printk(KERN_CRIT "Can't register IRQ %d for DMA channel %d\n", MXC_INT_DMACH0 + channel, channel); return ret; @@ -708,13 +711,6 @@ int imx_dma_request(int channel, const char *name) imxdma->watchdog.data = channel; #endif - imxdma->name = name; - imxdma->irq_handler = NULL; - imxdma->err_handler = NULL; - imxdma->data = NULL; - imxdma->sg = NULL; - - local_irq_restore(flags); return ret; } EXPORT_SYMBOL(imx_dma_request);