[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <h4twbib3pxrcmohckzg7d64moo5v5gjtdu3pz5wtroegdylcuh@7po5qbe3h2au>
Date: Mon, 10 Nov 2025 09:22:06 -0600
From: Bjorn Andersson <andersson@...nel.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Stefan Wahren <wahrenst@....net>, Vinod Koul <vkoul@...nel.org>,
Thomas Andreatta <thomasandreatta2000@...il.com>, Caleb Sander Mateos <csander@...estorage.com>,
dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-rpi-kernel@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org,
linux-arm-msm@...r.kernel.org, Olivier Dautricourt <olivierdautricourt@...il.com>,
Stefan Roese <sr@...x.de>, Florian Fainelli <florian.fainelli@...adcom.com>,
Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>, Ray Jui <rjui@...adcom.com>,
Scott Branden <sbranden@...adcom.com>, Lars-Peter Clausen <lars@...afoo.de>,
Eugeniy Paltsev <Eugeniy.Paltsev@...opsys.com>, Daniel Mack <daniel@...que.org>,
Haojian Zhuang <haojian.zhuang@...il.com>, Robert Jarzmik <robert.jarzmik@...e.fr>,
Lizhi Hou <lizhi.hou@....com>, Brian Xu <brian.xu@....com>,
Raj Kumar Rampelli <raj.kumar.rampelli@....com>, Michal Simek <michal.simek@....com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v2 00/13] dmaengine: introduce sg_nents_for_dma() and
convert users
On Mon, Nov 10, 2025 at 11:23:27AM +0100, Andy Shevchenko wrote:
> A handful of the DMAengine drivers use same routine to calculate the number of
> SG entries needed for the given DMA transfer. Provide a common helper for them
> and convert.
>
> I left the new helper on SG level of API because brief grepping shows potential
> candidates outside of DMA engine, e.g.:
>
> drivers/crypto/chelsio/chcr_algo.c:154: nents += DIV_ROUND_UP(less, entlen);
> drivers/spi/spi-stm32.c:1495: /* Count the number of entries needed */
>
Comment in patch 1, but for the rest.
Reviewed-by: Bjorn Andersson <andersson@...nel.org>
Regards,
Bjorn
> Changelog v2:
> - dropped outdated patches (only 9 years passed :-)
> - rebased on top of the current kernel
> - left API SG wide It might
>
> v1: https://patchwork.kernel.org/project/linux-dmaengine/patch/20161021173535.100245-1-andriy.shevchenko@linux.intel.com/
>
> Andy Shevchenko (13):
> scatterlist: introduce sg_nents_for_dma() helper
> dmaengine: altera-msgdma: use sg_nents_for_dma() helper
> dmaengine: axi-dmac: use sg_nents_for_dma() helper
> dmaengine: bcm2835-dma: use sg_nents_for_dma() helper
> dmaengine: dw-axi-dmac: use sg_nents_for_dma() helper
> dmaengine: k3dma: use sg_nents_for_dma() helper
> dmaengine: lgm: use sg_nents_for_dma() helper
> dmaengine: pxa-dma: use sg_nents_for_dma() helper
> dmaengine: qcom: adm: use sg_nents_for_dma() helper
> dmaengine: qcom: bam_dma: use sg_nents_for_dma() helper
> dmaengine: sa11x0: use sg_nents_for_dma() helper
> dmaengine: sh: use sg_nents_for_dma() helper
> dmaengine: xilinx: xdma: use sg_nents_for_dma() helper
>
> drivers/dma/altera-msgdma.c | 5 ++--
> drivers/dma/bcm2835-dma.c | 19 +-------------
> drivers/dma/dma-axi-dmac.c | 5 +---
> .../dma/dw-axi-dmac/dw-axi-dmac-platform.c | 6 ++---
> drivers/dma/k3dma.c | 9 ++-----
> drivers/dma/lgm/lgm-dma.c | 9 ++-----
> drivers/dma/pxa_dma.c | 5 ++--
> drivers/dma/qcom/bam_dma.c | 9 ++-----
> drivers/dma/qcom/qcom_adm.c | 9 +++----
> drivers/dma/sa11x0-dma.c | 6 ++---
> drivers/dma/sh/shdma-base.c | 5 ++--
> drivers/dma/xilinx/xdma.c | 6 ++---
> include/linux/scatterlist.h | 2 ++
> lib/scatterlist.c | 25 +++++++++++++++++++
> 14 files changed, 51 insertions(+), 69 deletions(-)
>
> --
> 2.50.1
>
>
Powered by blists - more mailing lists