* [PATCH v1 1/1] dmaengine: dw: disable BLOCK IRQs for non-cyclic xfer
@ 2016-02-10 13:59 Andy Shevchenko
2016-02-11 15:17 ` Måns Rullgård
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Andy Shevchenko @ 2016-02-10 13:59 UTC (permalink / raw)
To: Vinod Koul, dmaengine
Cc: Andy Shevchenko, Mans Rullgard, Viresh Kumar, stable
The commit 2895b2cad6e7 ("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: 2895b2cad6e7 ("dmaengine: dw: fix cyclic transfer callbacks")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mans Rullgard <mans@mansr.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: <stable@vger.kernel.org>
---
drivers/dma/dw/core.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
index e893318..5ad0ec1 100644
--- a/drivers/dma/dw/core.c
+++ b/drivers/dma/dw/core.c
@@ -156,7 +156,6 @@ static void dwc_initialize(struct dw_dma_chan *dwc)
/* Enable interrupts */
channel_set_bit(dw, MASK.XFER, dwc->mask);
- channel_set_bit(dw, MASK.BLOCK, dwc->mask);
channel_set_bit(dw, MASK.ERROR, dwc->mask);
dwc->initialized = true;
@@ -588,6 +587,9 @@ static void dwc_handle_cyclic(struct dw_dma *dw, struct dw_dma_chan *dwc,
spin_unlock_irqrestore(&dwc->lock, flags);
}
+
+ /* Re-enable interrupts */
+ channel_set_bit(dw, MASK.BLOCK, dwc->mask);
}
/* ------------------------------------------------------------------------- */
@@ -618,11 +620,8 @@ static void dw_dma_tasklet(unsigned long data)
dwc_scan_descriptors(dw, dwc);
}
- /*
- * Re-enable interrupts.
- */
+ /* Re-enable interrupts */
channel_set_bit(dw, MASK.XFER, dw->all_chan_mask);
- channel_set_bit(dw, MASK.BLOCK, dw->all_chan_mask);
channel_set_bit(dw, MASK.ERROR, dw->all_chan_mask);
}
@@ -1261,6 +1260,7 @@ static void dwc_free_chan_resources(struct dma_chan *chan)
int dw_dma_cyclic_start(struct dma_chan *chan)
{
struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
+ struct dw_dma *dw = to_dw_dma(chan->device);
unsigned long flags;
if (!test_bit(DW_DMA_IS_CYCLIC, &dwc->flags)) {
@@ -1269,7 +1269,12 @@ int dw_dma_cyclic_start(struct dma_chan *chan)
}
spin_lock_irqsave(&dwc->lock, flags);
+
+ /* Enable interrupts to perform cyclic transfer */
+ channel_set_bit(dw, MASK.BLOCK, dwc->mask);
+
dwc_dostart(dwc, dwc->cdesc->desc[0]);
+
spin_unlock_irqrestore(&dwc->lock, flags);
return 0;
--
2.7.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v1 1/1] dmaengine: dw: disable BLOCK IRQs for non-cyclic xfer
2016-02-10 13:59 [PATCH v1 1/1] dmaengine: dw: disable BLOCK IRQs for non-cyclic xfer Andy Shevchenko
@ 2016-02-11 15:17 ` Måns Rullgård
2016-02-12 6:33 ` Viresh Kumar
2016-02-15 16:51 ` Vinod Koul
2 siblings, 0 replies; 4+ messages in thread
From: Måns Rullgård @ 2016-02-11 15:17 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Vinod Koul, dmaengine, Viresh Kumar, stable
Andy Shevchenko <andriy.shevchenko@linux.intel.com> writes:
> The commit 2895b2cad6e7 ("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: 2895b2cad6e7 ("dmaengine: dw: fix cyclic transfer callbacks")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Mans Rullgard <mans@mansr.com>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: <stable@vger.kernel.org>
> ---
> drivers/dma/dw/core.c | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
Acked-by: Mans Rullgard <mans@mansr.com>
Tested-by: Mans Rullgard <mans@mansr.com>
> diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
> index e893318..5ad0ec1 100644
> --- a/drivers/dma/dw/core.c
> +++ b/drivers/dma/dw/core.c
> @@ -156,7 +156,6 @@ static void dwc_initialize(struct dw_dma_chan *dwc)
>
> /* Enable interrupts */
> channel_set_bit(dw, MASK.XFER, dwc->mask);
> - channel_set_bit(dw, MASK.BLOCK, dwc->mask);
> channel_set_bit(dw, MASK.ERROR, dwc->mask);
>
> dwc->initialized = true;
> @@ -588,6 +587,9 @@ static void dwc_handle_cyclic(struct dw_dma *dw, struct dw_dma_chan *dwc,
>
> spin_unlock_irqrestore(&dwc->lock, flags);
> }
> +
> + /* Re-enable interrupts */
> + channel_set_bit(dw, MASK.BLOCK, dwc->mask);
> }
>
> /* ------------------------------------------------------------------------- */
> @@ -618,11 +620,8 @@ static void dw_dma_tasklet(unsigned long data)
> dwc_scan_descriptors(dw, dwc);
> }
>
> - /*
> - * Re-enable interrupts.
> - */
> + /* Re-enable interrupts */
> channel_set_bit(dw, MASK.XFER, dw->all_chan_mask);
> - channel_set_bit(dw, MASK.BLOCK, dw->all_chan_mask);
> channel_set_bit(dw, MASK.ERROR, dw->all_chan_mask);
> }
>
> @@ -1261,6 +1260,7 @@ static void dwc_free_chan_resources(struct dma_chan *chan)
> int dw_dma_cyclic_start(struct dma_chan *chan)
> {
> struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
> + struct dw_dma *dw = to_dw_dma(chan->device);
> unsigned long flags;
>
> if (!test_bit(DW_DMA_IS_CYCLIC, &dwc->flags)) {
> @@ -1269,7 +1269,12 @@ int dw_dma_cyclic_start(struct dma_chan *chan)
> }
>
> spin_lock_irqsave(&dwc->lock, flags);
> +
> + /* Enable interrupts to perform cyclic transfer */
> + channel_set_bit(dw, MASK.BLOCK, dwc->mask);
> +
> dwc_dostart(dwc, dwc->cdesc->desc[0]);
> +
> spin_unlock_irqrestore(&dwc->lock, flags);
>
> return 0;
> --
> 2.7.0
>
--
M�ns Rullg�rd
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1 1/1] dmaengine: dw: disable BLOCK IRQs for non-cyclic xfer
2016-02-10 13:59 [PATCH v1 1/1] dmaengine: dw: disable BLOCK IRQs for non-cyclic xfer Andy Shevchenko
2016-02-11 15:17 ` Måns Rullgård
@ 2016-02-12 6:33 ` Viresh Kumar
2016-02-15 16:51 ` Vinod Koul
2 siblings, 0 replies; 4+ messages in thread
From: Viresh Kumar @ 2016-02-12 6:33 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Vinod Koul, dmaengine, Mans Rullgard, stable
On 10-02-16, 15:59, Andy Shevchenko wrote:
> The commit 2895b2cad6e7 ("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: 2895b2cad6e7 ("dmaengine: dw: fix cyclic transfer callbacks")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Mans Rullgard <mans@mansr.com>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: <stable@vger.kernel.org>
> ---
> drivers/dma/dw/core.c | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
--
viresh
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1 1/1] dmaengine: dw: disable BLOCK IRQs for non-cyclic xfer
2016-02-10 13:59 [PATCH v1 1/1] dmaengine: dw: disable BLOCK IRQs for non-cyclic xfer Andy Shevchenko
2016-02-11 15:17 ` Måns Rullgård
2016-02-12 6:33 ` Viresh Kumar
@ 2016-02-15 16:51 ` Vinod Koul
2 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2016-02-15 16:51 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: dmaengine, Mans Rullgard, Viresh Kumar, stable
On Wed, Feb 10, 2016 at 03:59:42PM +0200, Andy Shevchenko wrote:
> The commit 2895b2cad6e7 ("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.
Applied, thanks
--
~Vinod
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-02-15 16:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-10 13:59 [PATCH v1 1/1] dmaengine: dw: disable BLOCK IRQs for non-cyclic xfer Andy Shevchenko
2016-02-11 15:17 ` Måns Rullgård
2016-02-12 6:33 ` Viresh Kumar
2016-02-15 16:51 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).