diff options
author | Martin Fuzzey <mfuzzey@gmail.com> | 2009-03-26 17:27:52 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-05-05 03:36:36 -0400 |
commit | f2292532a5f0cf6359adca349cdd2a0150581937 (patch) | |
tree | c9387dadb67ce0d5548de95824eeab32d277afd9 | |
parent | de0096d80980e26fab16ac3eff57f47fadad92cb (diff) |
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 <mfuzzey@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/plat-mxc/dma-mx1-mx2.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/arch/arm/plat-mxc/dma-mx1-mx2.c b/arch/arm/plat-mxc/dma-mx1-mx2.c index a9126ed7935a..77646436c00e 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) | |||
693 | local_irq_restore(flags); | 693 | local_irq_restore(flags); |
694 | return -EBUSY; | 694 | return -EBUSY; |
695 | } | 695 | } |
696 | memset(imxdma, 0, sizeof(imxdma)); | ||
697 | imxdma->name = name; | ||
698 | local_irq_restore(flags); /* request_irq() can block */ | ||
696 | 699 | ||
697 | #ifdef CONFIG_ARCH_MX2 | 700 | #ifdef CONFIG_ARCH_MX2 |
698 | ret = request_irq(MXC_INT_DMACH0 + channel, dma_irq_handler, 0, "DMA", | 701 | ret = request_irq(MXC_INT_DMACH0 + channel, dma_irq_handler, 0, "DMA", |
699 | NULL); | 702 | NULL); |
700 | if (ret) { | 703 | if (ret) { |
701 | local_irq_restore(flags); | 704 | imxdma->name = NULL; |
702 | printk(KERN_CRIT "Can't register IRQ %d for DMA channel %d\n", | 705 | printk(KERN_CRIT "Can't register IRQ %d for DMA channel %d\n", |
703 | MXC_INT_DMACH0 + channel, channel); | 706 | MXC_INT_DMACH0 + channel, channel); |
704 | return ret; | 707 | return ret; |
@@ -708,13 +711,6 @@ int imx_dma_request(int channel, const char *name) | |||
708 | imxdma->watchdog.data = channel; | 711 | imxdma->watchdog.data = channel; |
709 | #endif | 712 | #endif |
710 | 713 | ||
711 | imxdma->name = name; | ||
712 | imxdma->irq_handler = NULL; | ||
713 | imxdma->err_handler = NULL; | ||
714 | imxdma->data = NULL; | ||
715 | imxdma->sg = NULL; | ||
716 | |||
717 | local_irq_restore(flags); | ||
718 | return ret; | 714 | return ret; |
719 | } | 715 | } |
720 | EXPORT_SYMBOL(imx_dma_request); | 716 | EXPORT_SYMBOL(imx_dma_request); |