* [PATCH v4 1/2] dmaengine: dw-edma: Fix unmasking STOP and ABORT interrupts for HDMA
2024-08-26 12:10 [PATCH v4 0/2] Fix unmasking interrupt bit and remove watermark interrupt enablement Mrinmay Sarkar
@ 2024-08-26 12:11 ` Mrinmay Sarkar
2024-08-26 12:11 ` [PATCH v4 2/2] dmaengine: dw-edma: Do not enable watermark " Mrinmay Sarkar
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Mrinmay Sarkar @ 2024-08-26 12:11 UTC (permalink / raw)
To: manivannan.sadhasivam, fancer.lancer, vkoul
Cc: quic_shazhuss, quic_nitegupt, quic_ramkri, quic_nayiluri,
quic_krichai, quic_vbadigan, Mrinmay Sarkar, stable, Cai Huoqing,
dmaengine, linux-kernel
The current logic is enabling both STOP_INT_MASK and ABORT_INT_MASK
bit. This is apparently masking those particular interrupts rather than
unmasking the same. If the interrupts are masked, they would never get
triggered.
So fix the issue by unmasking the STOP and ABORT interrupts properly.
Fixes: e74c39573d35 ("dmaengine: dw-edma: Add support for native HDMA")
cc: stable@vger.kernel.org
Signed-off-by: Mrinmay Sarkar <quic_msarkar@quicinc.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
drivers/dma/dw-edma/dw-hdma-v0-core.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/dw-edma/dw-hdma-v0-core.c b/drivers/dma/dw-edma/dw-hdma-v0-core.c
index 10e8f07..2addaca 100644
--- a/drivers/dma/dw-edma/dw-hdma-v0-core.c
+++ b/drivers/dma/dw-edma/dw-hdma-v0-core.c
@@ -247,10 +247,11 @@ static void dw_hdma_v0_core_start(struct dw_edma_chunk *chunk, bool first)
if (first) {
/* Enable engine */
SET_CH_32(dw, chan->dir, chan->id, ch_en, BIT(0));
- /* Interrupt enable&unmask - done, abort */
- tmp = GET_CH_32(dw, chan->dir, chan->id, int_setup) |
- HDMA_V0_STOP_INT_MASK | HDMA_V0_ABORT_INT_MASK |
- HDMA_V0_LOCAL_STOP_INT_EN | HDMA_V0_LOCAL_ABORT_INT_EN;
+ /* Interrupt unmask - stop, abort */
+ tmp = GET_CH_32(dw, chan->dir, chan->id, int_setup);
+ tmp &= ~(HDMA_V0_STOP_INT_MASK | HDMA_V0_ABORT_INT_MASK);
+ /* Interrupt enable - stop, abort */
+ tmp |= HDMA_V0_LOCAL_STOP_INT_EN | HDMA_V0_LOCAL_ABORT_INT_EN;
if (!(dw->chip->flags & DW_EDMA_CHIP_LOCAL))
tmp |= HDMA_V0_REMOTE_STOP_INT_EN | HDMA_V0_REMOTE_ABORT_INT_EN;
SET_CH_32(dw, chan->dir, chan->id, int_setup, tmp);
--
2.7.4
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH v4 2/2] dmaengine: dw-edma: Do not enable watermark interrupts for HDMA
2024-08-26 12:10 [PATCH v4 0/2] Fix unmasking interrupt bit and remove watermark interrupt enablement Mrinmay Sarkar
2024-08-26 12:11 ` [PATCH v4 1/2] dmaengine: dw-edma: Fix unmasking STOP and ABORT interrupts for HDMA Mrinmay Sarkar
@ 2024-08-26 12:11 ` Mrinmay Sarkar
2024-08-28 18:08 ` [PATCH v4 0/2] Fix unmasking interrupt bit and remove watermark interrupt enablement Vinod Koul
2024-08-29 7:12 ` Serge Semin
3 siblings, 0 replies; 5+ messages in thread
From: Mrinmay Sarkar @ 2024-08-26 12:11 UTC (permalink / raw)
To: manivannan.sadhasivam, fancer.lancer, vkoul
Cc: quic_shazhuss, quic_nitegupt, quic_ramkri, quic_nayiluri,
quic_krichai, quic_vbadigan, Mrinmay Sarkar, stable, Cai Huoqing,
dmaengine, linux-kernel
DW_HDMA_V0_LIE and DW_HDMA_V0_RIE are initialized as BIT(3) and BIT(4)
respectively in dw_hdma_control enum. But as per HDMA register these
bits are corresponds to LWIE and RWIE bit i.e local watermark interrupt
enable and remote watermarek interrupt enable. In linked list mode LWIE
and RWIE bits only enable the local and remote watermark interrupt.
Since the watermark interrupts are not used but enabled, this leads to
spurious interrupts getting generated. So remove the code that enables
them to avoid generating spurious watermark interrupts.
And also rename DW_HDMA_V0_LIE to DW_HDMA_V0_LWIE and DW_HDMA_V0_RIE to
DW_HDMA_V0_RWIE as there is no LIE and RIE bits in HDMA and those bits
are corresponds to LWIE and RWIE bits.
Fixes: e74c39573d35 ("dmaengine: dw-edma: Add support for native HDMA")
cc: stable@vger.kernel.org
Signed-off-by: Mrinmay Sarkar <quic_msarkar@quicinc.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
---
drivers/dma/dw-edma/dw-hdma-v0-core.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/drivers/dma/dw-edma/dw-hdma-v0-core.c b/drivers/dma/dw-edma/dw-hdma-v0-core.c
index 2addaca..e3f8db4 100644
--- a/drivers/dma/dw-edma/dw-hdma-v0-core.c
+++ b/drivers/dma/dw-edma/dw-hdma-v0-core.c
@@ -17,8 +17,8 @@ enum dw_hdma_control {
DW_HDMA_V0_CB = BIT(0),
DW_HDMA_V0_TCB = BIT(1),
DW_HDMA_V0_LLP = BIT(2),
- DW_HDMA_V0_LIE = BIT(3),
- DW_HDMA_V0_RIE = BIT(4),
+ DW_HDMA_V0_LWIE = BIT(3),
+ DW_HDMA_V0_RWIE = BIT(4),
DW_HDMA_V0_CCS = BIT(8),
DW_HDMA_V0_LLE = BIT(9),
};
@@ -195,25 +195,14 @@ static void dw_hdma_v0_write_ll_link(struct dw_edma_chunk *chunk,
static void dw_hdma_v0_core_write_chunk(struct dw_edma_chunk *chunk)
{
struct dw_edma_burst *child;
- struct dw_edma_chan *chan = chunk->chan;
u32 control = 0, i = 0;
- int j;
if (chunk->cb)
control = DW_HDMA_V0_CB;
- j = chunk->bursts_alloc;
- list_for_each_entry(child, &chunk->burst->list, list) {
- j--;
- if (!j) {
- control |= DW_HDMA_V0_LIE;
- if (!(chan->dw->chip->flags & DW_EDMA_CHIP_LOCAL))
- control |= DW_HDMA_V0_RIE;
- }
-
+ list_for_each_entry(child, &chunk->burst->list, list)
dw_hdma_v0_write_ll_data(chunk, i++, control, child->sz,
child->sar, child->dar);
- }
control = DW_HDMA_V0_LLP | DW_HDMA_V0_TCB;
if (!chunk->cb)
--
2.7.4
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v4 0/2] Fix unmasking interrupt bit and remove watermark interrupt enablement
2024-08-26 12:10 [PATCH v4 0/2] Fix unmasking interrupt bit and remove watermark interrupt enablement Mrinmay Sarkar
2024-08-26 12:11 ` [PATCH v4 1/2] dmaengine: dw-edma: Fix unmasking STOP and ABORT interrupts for HDMA Mrinmay Sarkar
2024-08-26 12:11 ` [PATCH v4 2/2] dmaengine: dw-edma: Do not enable watermark " Mrinmay Sarkar
@ 2024-08-28 18:08 ` Vinod Koul
2024-08-29 7:12 ` Serge Semin
3 siblings, 0 replies; 5+ messages in thread
From: Vinod Koul @ 2024-08-28 18:08 UTC (permalink / raw)
To: manivannan.sadhasivam, fancer.lancer, Mrinmay Sarkar
Cc: quic_shazhuss, quic_nitegupt, quic_ramkri, quic_nayiluri,
quic_krichai, quic_vbadigan, Cai Huoqing, dmaengine,
linux-kernel
On Mon, 26 Aug 2024 17:40:59 +0530, Mrinmay Sarkar wrote:
> This patch series reset STOP_INT_MASK and ABORT_INT_MASK bit and unmask
> these interrupt for HDMA.
>
> and also remove enablement of local watermark interrupt enable(LWIE)
> and remote watermarek interrupt enable(RWIE) bit to avoid unnecessary
> watermark interrupt event.
>
> [...]
Applied, thanks!
[1/2] dmaengine: dw-edma: Fix unmasking STOP and ABORT interrupts for HDMA
commit: 383baf5c8f062091af34c63f28d37642a8f188ae
[2/2] dmaengine: dw-edma: Do not enable watermark interrupts for HDMA
commit: 9f646ff25c09c52cebe726601db27a60f876f15e
Best regards,
--
~Vinod
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v4 0/2] Fix unmasking interrupt bit and remove watermark interrupt enablement
2024-08-26 12:10 [PATCH v4 0/2] Fix unmasking interrupt bit and remove watermark interrupt enablement Mrinmay Sarkar
` (2 preceding siblings ...)
2024-08-28 18:08 ` [PATCH v4 0/2] Fix unmasking interrupt bit and remove watermark interrupt enablement Vinod Koul
@ 2024-08-29 7:12 ` Serge Semin
3 siblings, 0 replies; 5+ messages in thread
From: Serge Semin @ 2024-08-29 7:12 UTC (permalink / raw)
To: Mrinmay Sarkar
Cc: manivannan.sadhasivam, vkoul, quic_shazhuss, quic_nitegupt,
quic_ramkri, quic_nayiluri, quic_krichai, quic_vbadigan,
Cai Huoqing, dmaengine, linux-kernel
On Mon, Aug 26, 2024 at 05:40:59PM +0530, Mrinmay Sarkar wrote:
> This patch series reset STOP_INT_MASK and ABORT_INT_MASK bit and unmask
> these interrupt for HDMA.
>
> and also remove enablement of local watermark interrupt enable(LWIE)
> and remote watermarek interrupt enable(RWIE) bit to avoid unnecessary
> watermark interrupt event.
>
> Testing
> -------
>
> Tested on Qualcomm SA8775P Platform.
>
> V3 -> V4:
> - convert IRQs unmasking in a clearer way as suggested by Serge.
Thanks for submitting the update. The patches have already been merged
in, but anyway here is my tag:
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
-Serge(y)
>
> V2 -> V3:
> - convert 'STOP, ABORT' to 'stop, abort' as suggested by Serge
> - Added Reviewed-by tag
>
> V1 -> V2:
> - Modified commit message and added Fixes, CC tag as suggested by Mani
> - reanme done to STOP
> - rename DW_HDMA_V0_LIE -> DW_HDMA_V0_LWIE and DW_HDMA_V0_RIE -> DW_HDMA_V0_RWIE
>
> Mrinmay Sarkar (2):
> dmaengine: dw-edma: Fix unmasking STOP and ABORT interrupts for HDMA
> dmaengine: dw-edma: Do not enable watermark interrupts for HDMA
>
> drivers/dma/dw-edma/dw-hdma-v0-core.c | 26 ++++++++------------------
> 1 file changed, 8 insertions(+), 18 deletions(-)
>
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 5+ messages in thread