All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	dmaengine@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH 1/3] dmaengine: sh: rz-dmac: Reinitialize lmdescriptor head
Date: Fri, 31 Mar 2023 17:44:46 +0530	[thread overview]
Message-ID: <ZCbOtrbTUlxGVWHd@matsya> (raw)
In-Reply-To: <20230324094957.115071-2-biju.das.jz@bp.renesas.com>

On 24-03-23, 09:49, Biju Das wrote:
> Reinitialize link mode descriptor head during terminate_all().
> It fixes the incorrect serial messages during serial transfer when
> DMA is enabled.
> 
> Based on a patch in the BSP by Long Luu
> <long.luu.ur@renesas.com>
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
>  drivers/dma/sh/rz-dmac.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c
> index 6b62e01ba658..a04a37ce03fd 100644
> --- a/drivers/dma/sh/rz-dmac.c
> +++ b/drivers/dma/sh/rz-dmac.c
> @@ -534,11 +534,18 @@ rz_dmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
>  static int rz_dmac_terminate_all(struct dma_chan *chan)
>  {
>  	struct rz_dmac_chan *channel = to_rz_dmac_chan(chan);
> +	struct rz_lmdesc *lmdesc = channel->lmdesc.base;
>  	unsigned long flags;
> +	unsigned int i;
> +
>  	LIST_HEAD(head);
>  
>  	rz_dmac_disable_hw(channel);
>  	spin_lock_irqsave(&channel->vc.lock, flags);
> +
> +	for (i = 0; i < DMAC_NR_LMDESC; i++)
> +		lmdesc[i].header = 0;

Any reason not to use memset for this?

> +
>  	list_splice_tail_init(&channel->ld_active, &channel->ld_free);
>  	list_splice_tail_init(&channel->ld_queue, &channel->ld_free);
>  	spin_unlock_irqrestore(&channel->vc.lock, flags);
> -- 
> 2.25.1

-- 
~Vinod

  reply	other threads:[~2023-03-31 12:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-24  9:49 [PATCH 0/3] RZ/G2L DMAC enhancements Biju Das
2023-03-24  9:49 ` [PATCH 1/3] dmaengine: sh: rz-dmac: Reinitialize lmdescriptor head Biju Das
2023-03-31 12:14   ` Vinod Koul [this message]
2023-03-31 15:20     ` Biju Das
2023-04-05  9:23       ` Biju Das
2023-03-24  9:49 ` [PATCH 2/3] dmaengine: sh: rz-dmac: Add device_tx_status() callback Biju Das
2023-03-31 12:16   ` Vinod Koul
2023-03-31 15:25     ` Biju Das
2023-03-24  9:49 ` [PATCH 3/3] dmaengine: sh: rz-dmac: Add device_pause() callback Biju Das
2023-03-31 12:17   ` Vinod Koul
2023-03-31 15:42     ` Biju Das

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=ZCbOtrbTUlxGVWHd@matsya \
    --to=vkoul@kernel.org \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.