public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v5 00/13] dmaengine: introduce sg_nents_for_dma() and convert users
@ 2026-01-08 10:50 Andy Shevchenko
  2026-01-08 10:50 ` [PATCH v5 01/13] scatterlist: introduce sg_nents_for_dma() helper Andy Shevchenko
                   ` (13 more replies)
  0 siblings, 14 replies; 16+ messages in thread
From: Andy Shevchenko @ 2026-01-08 10:50 UTC (permalink / raw)
  To: Bjorn Andersson, Andy Shevchenko, Nuno Sá, Vinod Koul,
	Bartosz Golaszewski, Thomas Andreatta, Caleb Sander Mateos,
	dmaengine, linux-kernel, linux-rpi-kernel, linux-arm-kernel,
	linux-arm-msm
  Cc: Olivier Dautricourt, Stefan Roese, Florian Fainelli,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Lars-Peter Clausen, Eugeniy Paltsev, Daniel Mack, Haojian Zhuang,
	Robert Jarzmik, Lizhi Hou, Brian Xu, Raj Kumar Rampelli,
	Michal Simek, Andrew Morton


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 */

Changelog v5:
- fixed W=1 warning (Vinod)
- `make W=1` the whole folder in allyesconfig and allmodconfig configurations

v4: <20251124121202.424072-1-andriy.shevchenko@linux.intel.com>

Changelog v4:
- fixed compilation errors (Vinod)

v3: <20251113151603.3031717-1-andriy.shevchenko@linux.intel.com>

Changelog v3:
- added missed EXPORT_SYMBOL() (Bjorn)
- left the return type as signed int (as agreed with Bjorn)
- collected tags (Bjorn)

v2: <20251110103805.3562136-1-andriy.shevchenko@linux.intel.com>

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/

*** BLURB HERE ***

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                   |  6 ++---
 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                             | 26 +++++++++++++++++++
 14 files changed, 52 insertions(+), 70 deletions(-)

-- 
2.50.1



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2026-01-09  3:14 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-08 10:50 [PATCH v5 00/13] dmaengine: introduce sg_nents_for_dma() and convert users Andy Shevchenko
2026-01-08 10:50 ` [PATCH v5 01/13] scatterlist: introduce sg_nents_for_dma() helper Andy Shevchenko
2026-01-08 10:50 ` [PATCH v5 02/13] dmaengine: altera-msgdma: use " Andy Shevchenko
2026-01-08 10:50 ` [PATCH v5 03/13] dmaengine: axi-dmac: " Andy Shevchenko
2026-01-08 13:40   ` Nuno Sá
2026-01-08 10:50 ` [PATCH v5 04/13] dmaengine: bcm2835-dma: " Andy Shevchenko
2026-01-08 10:50 ` [PATCH v5 05/13] dmaengine: dw-axi-dmac: " Andy Shevchenko
2026-01-08 10:50 ` [PATCH v5 06/13] dmaengine: k3dma: " Andy Shevchenko
2026-01-08 10:50 ` [PATCH v5 07/13] dmaengine: lgm: " Andy Shevchenko
2026-01-08 10:50 ` [PATCH v5 08/13] dmaengine: pxa-dma: " Andy Shevchenko
2026-01-08 10:50 ` [PATCH v5 09/13] dmaengine: qcom: adm: " Andy Shevchenko
2026-01-08 10:50 ` [PATCH v5 10/13] dmaengine: qcom: bam_dma: " Andy Shevchenko
2026-01-08 10:50 ` [PATCH v5 11/13] dmaengine: sa11x0: " Andy Shevchenko
2026-01-08 10:50 ` [PATCH v5 12/13] dmaengine: sh: " Andy Shevchenko
2026-01-08 10:50 ` [PATCH v5 13/13] dmaengine: xilinx: xdma: " Andy Shevchenko
2026-01-09  3:14 ` [PATCH v5 00/13] dmaengine: introduce sg_nents_for_dma() and convert users Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox