Skip to content

Commit ee1cdcd

Browse files
andy-shevVinod Koul
authored andcommitted
dmaengine: dw: disable BLOCK IRQs for non-cyclic xfer
The commit 2895b2c ("dmaengine: dw: fix cyclic transfer callbacks") re-enabled BLOCK interrupts with regard to make cyclic transfers work. However, this change becomes a regression for non-cyclic transfers as interrupt counters under stress test had been grown enormously (approximately per 4-5 bytes in the UART loop back test). Taking into consideration above enable BLOCK interrupts if and only if channel is programmed to perform cyclic transfer. Fixes: 2895b2c ("dmaengine: dw: fix cyclic transfer callbacks") Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Mans Rullgard <[email protected]> Tested-by: Mans Rullgard <[email protected]> Acked-by: Viresh Kumar <[email protected]> Cc: <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
1 parent 4ac31d1 commit ee1cdcd

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

drivers/dma/dw/core.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ static void dwc_initialize(struct dw_dma_chan *dwc)
156156

157157
/* Enable interrupts */
158158
channel_set_bit(dw, MASK.XFER, dwc->mask);
159-
channel_set_bit(dw, MASK.BLOCK, dwc->mask);
160159
channel_set_bit(dw, MASK.ERROR, dwc->mask);
161160

162161
dwc->initialized = true;
@@ -588,6 +587,9 @@ static void dwc_handle_cyclic(struct dw_dma *dw, struct dw_dma_chan *dwc,
588587

589588
spin_unlock_irqrestore(&dwc->lock, flags);
590589
}
590+
591+
/* Re-enable interrupts */
592+
channel_set_bit(dw, MASK.BLOCK, dwc->mask);
591593
}
592594

593595
/* ------------------------------------------------------------------------- */
@@ -618,11 +620,8 @@ static void dw_dma_tasklet(unsigned long data)
618620
dwc_scan_descriptors(dw, dwc);
619621
}
620622

621-
/*
622-
* Re-enable interrupts.
623-
*/
623+
/* Re-enable interrupts */
624624
channel_set_bit(dw, MASK.XFER, dw->all_chan_mask);
625-
channel_set_bit(dw, MASK.BLOCK, dw->all_chan_mask);
626625
channel_set_bit(dw, MASK.ERROR, dw->all_chan_mask);
627626
}
628627

@@ -1261,6 +1260,7 @@ static void dwc_free_chan_resources(struct dma_chan *chan)
12611260
int dw_dma_cyclic_start(struct dma_chan *chan)
12621261
{
12631262
struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
1263+
struct dw_dma *dw = to_dw_dma(chan->device);
12641264
unsigned long flags;
12651265

12661266
if (!test_bit(DW_DMA_IS_CYCLIC, &dwc->flags)) {
@@ -1269,7 +1269,12 @@ int dw_dma_cyclic_start(struct dma_chan *chan)
12691269
}
12701270

12711271
spin_lock_irqsave(&dwc->lock, flags);
1272+
1273+
/* Enable interrupts to perform cyclic transfer */
1274+
channel_set_bit(dw, MASK.BLOCK, dwc->mask);
1275+
12721276
dwc_dostart(dwc, dwc->cdesc->desc[0]);
1277+
12731278
spin_unlock_irqrestore(&dwc->lock, flags);
12741279

12751280
return 0;

0 commit comments

Comments
 (0)