public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Péter Ujfalusi" <peter.ujfalusi@gmail.com>
To: Jai Luthra <j-luthra@ti.com>, Vinod Koul <vkoul@kernel.org>,
	Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	Vignesh Raghavendra <vigneshr@ti.com>
Subject: Re: [PATCH] dmaengine: ti: k3-udma: Report short packet errors
Date: Mon, 8 Jan 2024 09:55:03 +0200	[thread overview]
Message-ID: <3e8ffbce-e894-4130-b9a2-f267ba54ee12@gmail.com> (raw)
In-Reply-To: <20240103-tr_resp_err-v1-1-2fdf6d48ab92@ti.com>



On 03/01/2024 11:07, Jai Luthra wrote:
> Propagate the TR response status to the device using BCDMA
> split-channels. For example CSI-RX driver should be able to check if a
> frame was not transferred completely (short packet) and needs to be
> discarded.

Make sense,

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

> 
> Fixes: 25dcb5dd7b7c ("dmaengine: ti: New driver for K3 UDMA")
> Signed-off-by: Jai Luthra <j-luthra@ti.com>
> ---
>  drivers/dma/ti/k3-udma.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
> index 30fd2f386f36..037f1408e798 100644
> --- a/drivers/dma/ti/k3-udma.c
> +++ b/drivers/dma/ti/k3-udma.c
> @@ -3968,6 +3968,7 @@ static void udma_desc_pre_callback(struct virt_dma_chan *vc,
>  {
>  	struct udma_chan *uc = to_udma_chan(&vc->chan);
>  	struct udma_desc *d;
> +	u8 status;
>  
>  	if (!vd)
>  		return;
> @@ -3977,12 +3978,12 @@ static void udma_desc_pre_callback(struct virt_dma_chan *vc,
>  	if (d->metadata_size)
>  		udma_fetch_epib(uc, d);
>  
> -	/* Provide residue information for the client */
>  	if (result) {
>  		void *desc_vaddr = udma_curr_cppi5_desc_vaddr(d, d->desc_idx);
>  
>  		if (cppi5_desc_get_type(desc_vaddr) ==
>  		    CPPI5_INFO0_DESC_TYPE_VAL_HOST) {
> +			/* Provide residue information for the client */
>  			result->residue = d->residue -
>  					  cppi5_hdesc_get_pktlen(desc_vaddr);
>  			if (result->residue)
> @@ -3991,7 +3992,12 @@ static void udma_desc_pre_callback(struct virt_dma_chan *vc,
>  				result->result = DMA_TRANS_NOERROR;
>  		} else {
>  			result->residue = 0;
> -			result->result = DMA_TRANS_NOERROR;
> +			/* Propagate TR Response errors to the client */
> +			status = d->hwdesc[0].tr_resp_base->status;
> +			if (status)
> +				result->result = DMA_TRANS_ABORTED;
> +			else
> +				result->result = DMA_TRANS_NOERROR;
>  		}
>  	}
>  }
> 
> ---
> base-commit: 610a9b8f49fbcf1100716370d3b5f6f884a2835a
> change-id: 20240103-tr_resp_err-9f4eebbdcd3b
> 
> Best regards,

-- 
Péter

  reply	other threads:[~2024-01-08  7:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-03  9:07 [PATCH] dmaengine: ti: k3-udma: Report short packet errors Jai Luthra
2024-01-08  7:55 ` Péter Ujfalusi [this message]
2024-01-22 16:25 ` 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=3e8ffbce-e894-4130-b9a2-f267ba54ee12@gmail.com \
    --to=peter.ujfalusi@gmail.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=grygorii.strashko@ti.com \
    --cc=j-luthra@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.ujfalusi@ti.com \
    --cc=vigneshr@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