public inbox for dmaengine@vger.kernel.org
 help / color / mirror / Atom feed
From: "Péter Ujfalusi" <peter.ujfalusi@gmail.com>
To: Jayesh Choudhary <j-choudhary@ti.com>, vkoul@kernel.org
Cc: vaishnav.a@ti.com, dmaengine@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dmaengine: ti: k3-udma: Do conditional decrement of UDMA_CHAN_RT_PEER_BCNT_REG
Date: Tue, 29 Nov 2022 18:27:32 +0200	[thread overview]
Message-ID: <e032e055-9677-f332-b4a8-93acb25b78ec@gmail.com> (raw)
In-Reply-To: <20221128085005.489964-1-j-choudhary@ti.com>



On 28/11/2022 10:50, Jayesh Choudhary wrote:
> PSIL_EP_NATIVE endpoints may not have PEER registers for BCNT and thus
> udma_decrement_byte_counters() should not try to decrement these counters.
> This fixes the issue of crypto IPERF testing where the client side (EVM)
> hangs without transfer of packets to the server side, seen since this
> function was added.

Right, the BCNT is available on PDMA_XY for sure, I don't know if it is 
on AASRC/MCAN type tho, but they are not used right now.

I might clarify and use ep_type == PSIL_EP_PDMA_XY to be sure that only 
the known variant is handled, but this is fine as well.

Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>

> 
> Fixes: 7c94dcfa8fcf ("dmaengine: ti: k3-udma: Reset UDMA_CHAN_RT byte counters to prevent overflow")
> Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
> ---
>   drivers/dma/ti/k3-udma.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
> index ce8b80bb34d7..4c62274e0b33 100644
> --- a/drivers/dma/ti/k3-udma.c
> +++ b/drivers/dma/ti/k3-udma.c
> @@ -762,11 +762,12 @@ static void udma_decrement_byte_counters(struct udma_chan *uc, u32 val)
>   	if (uc->desc->dir == DMA_DEV_TO_MEM) {
>   		udma_rchanrt_write(uc, UDMA_CHAN_RT_BCNT_REG, val);
>   		udma_rchanrt_write(uc, UDMA_CHAN_RT_SBCNT_REG, val);
> -		udma_rchanrt_write(uc, UDMA_CHAN_RT_PEER_BCNT_REG, val);
> +		if (uc->config.ep_type != PSIL_EP_NATIVE)
> +			udma_rchanrt_write(uc, UDMA_CHAN_RT_PEER_BCNT_REG, val);
>   	} else {
>   		udma_tchanrt_write(uc, UDMA_CHAN_RT_BCNT_REG, val);
>   		udma_tchanrt_write(uc, UDMA_CHAN_RT_SBCNT_REG, val);
> -		if (!uc->bchan)
> +		if (!uc->bchan && uc->config.ep_type != PSIL_EP_NATIVE)
>   			udma_tchanrt_write(uc, UDMA_CHAN_RT_PEER_BCNT_REG, val);
>   	}
>   }

-- 
Péter

  reply	other threads:[~2022-11-29 16:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28  8:50 [PATCH] dmaengine: ti: k3-udma: Do conditional decrement of UDMA_CHAN_RT_PEER_BCNT_REG Jayesh Choudhary
2022-11-29 16:27 ` Péter Ujfalusi [this message]
2022-12-28 11:04 ` Vinod Koul

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=e032e055-9677-f332-b4a8-93acb25b78ec@gmail.com \
    --to=peter.ujfalusi@gmail.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=j-choudhary@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vaishnav.a@ti.com \
    --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