Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Baruch Siach via buildroot <buildroot@buildroot.org>
To: Maxim Kochetkov via buildroot <buildroot@buildroot.org>
Cc: Maxim Kochetkov <fido_max@inbox.ru>
Subject: Re: [Buildroot] [PATCH 1/1] dmaengine: dw-axi-dmac: fix snps, axi-max-burst-len settings
Date: Thu, 28 Nov 2024 07:15:44 +0200	[thread overview]
Message-ID: <87iks87xbz.fsf@tarshish> (raw)
In-Reply-To: <20241128050116.879176-1-fido_max@inbox.ru> (Maxim Kochetkov via buildroot's message of "Thu, 28 Nov 2024 08:01:16 +0300")

Hi Maxim,

On Thu, Nov 28 2024, Maxim Kochetkov via buildroot wrote:
> axi_rw_burst_len allowed values range is 1..256. Then this value
> goes to ARLEN/AWLEN 8-bit fields of lli->ctl_hi. So writing 256
> leads to overflow and overwrites another fields in LLI. More over
> ARLEN/AWLEN are zero based (0 - 1, 256 - 255).
>
> Fixes: c454d16a7d5a ("dmaengine: dw-axi-dmac: Burst length settings")
> Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>

This is the wrong list for this patch, I believe.

baruch

> ---
>  drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> index b23536645ff7..9aa79e9b49ca 100644
> --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> @@ -1437,7 +1437,7 @@ static int parse_device_properties(struct axi_dma_chip *chip)
>  			return -EINVAL;
>  
>  		chip->dw->hdata->restrict_axi_burst_len = true;
> -		chip->dw->hdata->axi_rw_burst_len = tmp;
> +		chip->dw->hdata->axi_rw_burst_len = tmp - 1;
>  	}
>  
>  	return 0;
> @@ -1550,7 +1550,7 @@ static int dw_probe(struct platform_device *pdev)
>  	dma_cap_set(DMA_CYCLIC, dw->dma.cap_mask);
>  
>  	/* DMA capabilities */
> -	dw->dma.max_burst = hdata->axi_rw_burst_len;
> +	dw->dma.max_burst = hdata->axi_rw_burst_len + 1;
>  	dw->dma.src_addr_widths = AXI_DMA_BUSWIDTHS;
>  	dw->dma.dst_addr_widths = AXI_DMA_BUSWIDTHS;
>  	dw->dma.directions = BIT(DMA_MEM_TO_MEM);

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2024-11-28  5:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-28  5:01 [Buildroot] [PATCH 1/1] dmaengine: dw-axi-dmac: fix snps, axi-max-burst-len settings Maxim Kochetkov via buildroot
2024-11-28  5:15 ` Baruch Siach via buildroot [this message]
2024-11-28  6:08   ` Maxim Kochetkov via buildroot

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=87iks87xbz.fsf@tarshish \
    --to=buildroot@buildroot.org \
    --cc=baruch@tkos.co.il \
    --cc=fido_max@inbox.ru \
    /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