mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4 00/10] dmaengine: Support bus widths of 32 bytes and above
@ 2026-09-11 17:25 Nuno Sá
  2026-09-11 17:25 ` [PATCH v4 01/10] dmaengine: Move enum dma_slave_buswidth to a new header Nuno Sá
                   ` (9 more replies)
  0 siblings, 10 replies; 21+ messages in thread
From: Nuno Sá @ 2026-09-11 17:25 UTC (permalink / raw)
  To: linux-kernel, dmaengine, linux-arm-msm, linux-stm32,
	linux-arm-kernel, linux-iio, linux-sound, linux-spi
  Cc: Vinod Koul, Frank Li, Lars-Peter Clausen, Eugeniy Paltsev,
	Amélie Delaunay, Maxime Coquelin, Alexandre Torgue,
	Jonathan Cameron, David Lechner, Andy Shevchenko,
	Jaroslav Kysela, Takashi Iwai, Mark Brown, Andy Shevchenko,
	Frank Li, Jonathan Cameron

The DMA engine slave capabilities advertise the supported source and
destination bus widths through src_addr_widths / dst_addr_widths. These
are plain u32 bitmasks where a set bit's position equals the
corresponding enum dma_slave_buswidth value, e.g.
DMA_SLAVE_BUSWIDTH_4_BYTES sets bit 4.

The consequence is that widths of 32 bytes and above cannot be
represented at all: DMA_SLAVE_BUSWIDTH_32/64/128_BYTES would need bits
32, 64 and 128, which do not fit in a u32. Hardware with wider data
paths is becoming common, so add a representation that can express these
widths while still using enum dma_slave_buswidth.

This series switches consumers and a small set of producers to the new
bus width capabilities, represented by a dma_buswidth_mask_t modeled
after dma_cap_mask_t. The legacy dma_device u32 fields are kept for now
so the remaining DMA controller drivers can be converted incrementally:
dma_async_device_register() folds a legacy-only producer's u32 into the
mask, so consumers only ever have to look at the mask.

The new interface lives in include/linux/dma/engine/{types,widthmask}.h
rather than in linux/dmaengine.h, so that only its users pay for the
linux/bitmap.h include. Every accessor takes a dma_buswidth_mask_t,
which means the interface will not change when the legacy fields are
eventually dropped.

Once the remaining producers are converted, the legacy dma_device
src/dst_addr_widths fields can be removed as a final cleanup.

This issue was discussed before here:

https://lore.kernel.org/dmaengine/abkoXXbaxaiqbBuX@vaman/

Changes in v4:
- Patch 1 (new):
  - Split out of the old patch 1: move enum dma_slave_buswidth into the
    new include/linux/dma/engine/types.h, with no other change (Andy).
  - While at it, add the missing kernel-doc for the enum members, which
    kernel-doc warned about already before this series, and describe the
    UNDEFINED case (Andy).
- Patch 2:
  - Fold the bus width masks in both directions in
    dma_async_device_register(). A producer already converted only fills
    in the mask, so the legacy u32 stayed zero and the consumers not
    converted yet ended up with no bus width at all: IIO fell back to a
    width of 1 and spi-dw disabled DMA entirely. Derive the legacy u32
    from the mask so every intermediate commit of this series keeps
    working (sashiko-bot). Dropped again in the last patch.
  - widthmask.h: include linux/errno.h and group the generic linux/*.h
    includes before the subsystem ones (Andy).
  - Split declaration and assignment in __dma_bus_width_min() (Andy).
  - Group linux/dma/engine/types.h after the generic includes in
    linux/dmaengine.h (Andy).
  - Drop the include/linux/dma/engine/ MAINTAINERS entry, as
    include/linux/dma/ already matches recursively (Andy).
  - Drop bitops.h include (Andy).
- Patch 3, 4, 5, 7:
  - Fix the helper names in the commit messages, which still referred to
    the v2 interface (sashiko-bot).
- Patch 6:
  - Drop the claim about an unvalidated device tree bus width from the
    commit message, as sdw/ddw do not come from the device tree
    (Amelie).
- Patch 9:
  - Sort the new linux/dma/engine/types.h include in spi-dw.h (Andy).
- Link to v3: https://patch.msgid.link/20260831-dmaengine-support-wider-dma-masks-v3-0-507d97496f2d@analog.com

---
Nuno Sá (10):
      dmaengine: Move enum dma_slave_buswidth to a new header
      dmaengine: Support bus widths of 32 bytes and above
      dmaengine: dma-axi-dmac: Use bus width capability helpers
      dmaengine: dw-axi-dmac: Use bus width capability helpers
      dmaengine: qcom: gpi: Use bus width capability helpers
      dmaengine: stm32-dma3: Use bus width capability helpers
      iio: buffer-dmaengine: Use dma_slave_caps bus width accessors
      ALSA: pcm_dmaengine: Use dma_slave_caps bus width helpers
      spi: dw: Use dma_slave_caps bus width helpers
      dmaengine: Drop legacy bus width fields from dma_slave_caps

 drivers/dma/dma-axi-dmac.c                         |  14 +-
 drivers/dma/dmaengine.c                            |  25 +++-
 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c     |  38 +++--
 drivers/dma/qcom/gpi.c                             |  12 +-
 drivers/dma/stm32/stm32-dma3.c                     |  34 +++--
 drivers/iio/buffer/industrialio-buffer-dmaengine.c |  16 +-
 drivers/spi/spi-dw-dma.c                           |   8 +-
 drivers/spi/spi-dw.h                               |   3 +-
 include/linux/dma/engine/types.h                   |  55 +++++++
 include/linux/dma/engine/widthmask.h               | 166 +++++++++++++++++++++
 include/linux/dmaengine.h                          |  49 +++---
 sound/core/pcm_dmaengine.c                         |  21 ++-
 12 files changed, 357 insertions(+), 84 deletions(-)
---
base-commit: 0613e7934ee233d726af8d8c89f251a1c4df738d
change-id: 20260615-dmaengine-support-wider-dma-masks-5aac12497e27
--

Thanks!
- Nuno Sá


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

end of thread, other threads:[~2026-09-15  8:13 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-11 17:25 [PATCH v4 00/10] dmaengine: Support bus widths of 32 bytes and above Nuno Sá
2026-09-11 17:25 ` [PATCH v4 01/10] dmaengine: Move enum dma_slave_buswidth to a new header Nuno Sá
2026-09-12  7:57   ` Andy Shevchenko
2026-09-14 14:18   ` Frank Li
2026-09-14 15:40     ` Nuno Sá
2026-09-15  7:29     ` Andy Shevchenko
2026-09-11 17:25 ` [PATCH v4 02/10] dmaengine: Support bus widths of 32 bytes and above Nuno Sá
2026-09-14  8:05   ` Andy Shevchenko
2026-09-11 17:25 ` [PATCH v4 03/10] dmaengine: dma-axi-dmac: Use bus width capability helpers Nuno Sá
2026-09-11 17:25 ` [PATCH v4 04/10] dmaengine: dw-axi-dmac: " Nuno Sá
2026-09-11 17:25 ` [PATCH v4 05/10] dmaengine: qcom: gpi: " Nuno Sá
2026-09-11 17:25 ` [PATCH v4 06/10] dmaengine: stm32-dma3: " Nuno Sá
2026-09-11 17:25 ` [PATCH v4 07/10] iio: buffer-dmaengine: Use dma_slave_caps bus width accessors Nuno Sá
2026-09-14  8:06   ` Andy Shevchenko
2026-09-11 17:25 ` [PATCH v4 08/10] ALSA: pcm_dmaengine: Use dma_slave_caps bus width helpers Nuno Sá
2026-09-14  8:12   ` Andy Shevchenko
2026-09-14 15:39     ` Nuno Sá
2026-09-15  7:31       ` Andy Shevchenko
2026-09-15  8:13         ` Nuno Sá
2026-09-11 17:25 ` [PATCH v4 09/10] spi: dw: " Nuno Sá
2026-09-11 17:25 ` [PATCH v4 10/10] dmaengine: Drop legacy bus width fields from dma_slave_caps Nuno Sá

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

all inboxes | Powered by JetHome®