From: Mrinmay Sarkar <quic_msarkar@quicinc.com>
To: Serge Semin <fancer.lancer@gmail.com>
Cc: <manivannan.sadhasivam@linaro.org>, <vkoul@kernel.org>,
<quic_shazhuss@quicinc.com>, <quic_nitegupt@quicinc.com>,
<quic_ramkri@quicinc.com>, <quic_nayiluri@quicinc.com>,
<quic_krichai@quicinc.com>, <quic_vbadigan@quicinc.com>,
<stable@vger.kernel.org>, Cai Huoqing <cai.huoqing@linux.dev>,
<dmaengine@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] dmaengine: dw-edma: Fix unmasking STOP and ABORT interrupts for HDMA
Date: Wed, 7 Aug 2024 22:49:42 +0530 [thread overview]
Message-ID: <b7fd3fac-77e4-7aad-e97a-c210aeb53773@quicinc.com> (raw)
In-Reply-To: <by7uqtmnx4jjxigbm3lrpp2b3eqcrq3byqrrmexmkkigtjxdir@o7ahdlhpgzjl>
On 8/7/2024 4:26 AM, Serge Semin wrote:
> On Mon, Aug 05, 2024 at 07:30:14PM +0530, Mrinmay Sarkar wrote:
>> On 8/2/2024 5:12 AM, Serge Semin wrote:
>>> On Tue, Jul 23, 2024 at 06:49:31PM +0530, Mrinmay Sarkar wrote:
>>>> 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>
>>>> ---
>>>> 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..fa89b3a 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;
>>> Just curious, if all the interrupts were actually masked, how has this
>>> been even working?.. In other words if it affected both local and
>>> remote interrupts, then the HDMA driver has never actually worked,
>>> right?
>> Agreed, it should not work as interrupts were masked.
>>
>> But as we are enabling LIE/RIE bits (LWIE/RWIE) that eventually enabling
>> watermark
>> interrupt in HDMA case and somehow on device I could see interrupt was
>> generating with watermark and stop bit set and it was working.
>> Since we were not clearing watermark interrupt, it was also causing storm of
>> interrupt.
> Is it possible that the HDMA_V0_STOP_INT_MASK and
> HDMA_V0_ABORT_INT_MASK masks affect the local IRQs only? If so than
> that shall explain why for instance Kory hasn't met the problem.
>
> Based on the "Interrupts and Error Handling" figures of the DW EDMA
> databook the DMA_READ_INT_MASK_OFF/DMA_WRITE_INT_MASK_OFF CSRs mask of
> the IRQ delivered via the edma_int[] wire. Meanwhile the IMWr TLPs
> generation depend on the RIE/LLRAIE flags state only.
Ideally HDMA_V0_STOP_INT_MASK and HDMA_V0_ABORT_INT_MASK masks affect
both local and remote IRQs.
As per DW HDMA "Interrupts and Error Handling" figure
HDMA_INT_SETUP_OFF_[WR|
RD] mask of the IRQ delivered via the edma_int[] wire.
And IMWr TLPs generation depend on 3 flags i.e HDMA_INT_SETUP_OFF_[WR|
RD].RSIE flag for stop IMWr, RWIE flag for watermark IMWr and
HDMA_INT_SETUP_OFF_[WR|R
D].RAIE flag for abort IMWr generation.
Thanks,
Mrinmay
>>>> + /* Interrupt unmask - STOP, ABORT */
>>>> + tmp = GET_CH_32(dw, chan->dir, chan->id, int_setup) &
>>>> + ~HDMA_V0_STOP_INT_MASK & ~HDMA_V0_ABORT_INT_MASK;
>>> Please convert this to:
>>> + /* 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);
>>>
>>> -Serge(y)
>> Sure. Will do
> Thanks.
>
> -Serge(y)
>
>> Thanks,
>> Mrinmay
>>
>>>> + /* 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
>>>>
next prev parent reply other threads:[~2024-08-07 17:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-23 13:19 [PATCH v2 0/2] Fix unmasking interrupt bit and remove watermark interrupt enablement Mrinmay Sarkar
2024-07-23 13:19 ` [PATCH v2 1/2] dmaengine: dw-edma: Fix unmasking STOP and ABORT interrupts for HDMA Mrinmay Sarkar
2024-07-25 8:01 ` Manivannan Sadhasivam
2024-08-01 23:42 ` Serge Semin
2024-08-05 14:00 ` Mrinmay Sarkar
2024-08-06 22:56 ` Serge Semin
2024-08-07 17:19 ` Mrinmay Sarkar [this message]
2024-08-08 20:28 ` Serge Semin
2024-07-23 13:19 ` [PATCH v2 2/2] dmaengine: dw-edma: Do not enable watermark " Mrinmay Sarkar
2024-07-25 8:03 ` Manivannan Sadhasivam
2024-08-02 0:34 ` Serge Semin
2024-08-05 14:04 ` Mrinmay Sarkar
2024-08-06 22:35 ` Serge Semin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b7fd3fac-77e4-7aad-e97a-c210aeb53773@quicinc.com \
--to=quic_msarkar@quicinc.com \
--cc=cai.huoqing@linux.dev \
--cc=dmaengine@vger.kernel.org \
--cc=fancer.lancer@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=quic_krichai@quicinc.com \
--cc=quic_nayiluri@quicinc.com \
--cc=quic_nitegupt@quicinc.com \
--cc=quic_ramkri@quicinc.com \
--cc=quic_shazhuss@quicinc.com \
--cc=quic_vbadigan@quicinc.com \
--cc=stable@vger.kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®