Skip to content

Commit

Permalink
at_hdmac: bugfix for enabling channel irq
Browse files Browse the repository at this point in the history
commit bda3a47 upstream.

commit 4638947 deleted redundant
chan_id and chancnt initialization in dma drivers as this is done
in dma_async_device_register().

However, atc_enable_irq() relied on chan_id set before registering
the device, what left only channel 0 functional for this driver.

This patch introduces atc_enable/disable_chan_irq() as a variant
of atc_enable/disable_irq() with the channel as explicit argument.

Signed-off-by: Nikolaus Voss <n.voss@weinmann.de>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Nikolaus Voss authored and koenkooi committed May 23, 2012
1 parent 5272441 commit bed599f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions drivers/dma/at_hdmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,7 @@ static int __init at_dma_probe(struct platform_device *pdev)

tasklet_init(&atchan->tasklet, atc_tasklet,
(unsigned long)atchan);
atc_enable_irq(atchan);
atc_enable_chan_irq(atdma, i);
}

/* set base routines */
Expand Down Expand Up @@ -1353,7 +1353,7 @@ static int __exit at_dma_remove(struct platform_device *pdev)
struct at_dma_chan *atchan = to_at_dma_chan(chan);

/* Disable interrupts */
atc_disable_irq(atchan);
atc_disable_chan_irq(atdma, chan->chan_id);
tasklet_disable(&atchan->tasklet);

tasklet_kill(&atchan->tasklet);
Expand Down
17 changes: 8 additions & 9 deletions drivers/dma/at_hdmac_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,28 +326,27 @@ static void atc_dump_lli(struct at_dma_chan *atchan, struct at_lli *lli)
}


static void atc_setup_irq(struct at_dma_chan *atchan, int on)
static void atc_setup_irq(struct at_dma *atdma, int chan_id, int on)
{
struct at_dma *atdma = to_at_dma(atchan->chan_common.device);
u32 ebci;
u32 ebci;

/* enable interrupts on buffer transfer completion & error */
ebci = AT_DMA_BTC(atchan->chan_common.chan_id)
| AT_DMA_ERR(atchan->chan_common.chan_id);
ebci = AT_DMA_BTC(chan_id)
| AT_DMA_ERR(chan_id);
if (on)
dma_writel(atdma, EBCIER, ebci);
else
dma_writel(atdma, EBCIDR, ebci);
}

static inline void atc_enable_irq(struct at_dma_chan *atchan)
static void atc_enable_chan_irq(struct at_dma *atdma, int chan_id)
{
atc_setup_irq(atchan, 1);
atc_setup_irq(atdma, chan_id, 1);
}

static inline void atc_disable_irq(struct at_dma_chan *atchan)
static void atc_disable_chan_irq(struct at_dma *atdma, int chan_id)
{
atc_setup_irq(atchan, 0);
atc_setup_irq(atdma, chan_id, 0);
}


Expand Down

0 comments on commit bed599f

Please sign in to comment.