mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v5 0/9] dmaengine: Support bus widths of 32 bytes and above
@ 2026-10-09 15:52 Nuno Sá
  2026-10-09 15:52 ` [PATCH v5 1/9] " Nuno Sá
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Nuno Sá @ 2026-10-09 15:52 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, Frank Li,
	Jonathan Cameron, Andy Shevchenko

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.

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 v5:
- Drop the "Move enum dma_slave_buswidth to a new header" patch and the
  include/linux/dma/engine/{types,widthmask}.h split. The bus width
  type and helpers now live in linux/dmaengine.h, next to
  enum dma_slave_buswidth, as both consumers and providers use them
  (Vinod, Frank).
- Patch 1:
  - Move dma_buswidth_mask_t and the bus width helpers into
    linux/dmaengine.h and drop the linux/bitops.h include.
  - Document that dma_bus_width_set{,_many}() add to the mask, like
    __set_bit(), so the caller initializes it (Andy).
  - Drop Andy's Acked-by given the header rework.
- Patch 2-8:
  - Drop the linux/dma/engine/widthmask.h include.
- Patch 8:
  - Include linux/dmaengine.h in spi-dw.h instead of
    linux/dma/engine/types.h.
- Link to v4: https://patch.msgid.link/20260911-dmaengine-support-wider-dma-masks-v4-0-72b8fd4cc78e@analog.com

---
Nuno Sá (9):
      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                         |  13 +-
 drivers/dma/dmaengine.c                            |  24 ++-
 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c     |  37 ++--
 drivers/dma/qcom/gpi.c                             |  11 +-
 drivers/dma/stm32/stm32-dma3.c                     |  33 ++--
 drivers/iio/buffer/industrialio-buffer-dmaengine.c |  15 +-
 drivers/spi/spi-dw-dma.c                           |   7 +-
 drivers/spi/spi-dw.h                               |   3 +-
 include/linux/dmaengine.h                          | 199 +++++++++++++++++++--
 sound/core/pcm_dmaengine.c                         |  20 ++-
 10 files changed, 295 insertions(+), 67 deletions(-)
---
base-commit: 511afae96d89847f753fcab6b3a597f0281be9d5
change-id: 20260615-dmaengine-support-wider-dma-masks-5aac12497e27
--

Thanks!
- Nuno Sá


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

end of thread, other threads:[~2026-10-10  2:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-09 15:52 [PATCH v5 0/9] dmaengine: Support bus widths of 32 bytes and above Nuno Sá
2026-10-09 15:52 ` [PATCH v5 1/9] " Nuno Sá
2026-10-09 19:33   ` Frank Li
2026-10-10  2:45   ` Frank Li
2026-10-09 15:52 ` [PATCH v5 2/9] dmaengine: dma-axi-dmac: Use bus width capability helpers Nuno Sá
2026-10-09 15:52 ` [PATCH v5 3/9] dmaengine: dw-axi-dmac: " Nuno Sá
2026-10-09 15:52 ` [PATCH v5 4/9] dmaengine: qcom: gpi: " Nuno Sá
2026-10-09 15:52 ` [PATCH v5 5/9] dmaengine: stm32-dma3: " Nuno Sá
2026-10-09 15:52 ` [PATCH v5 6/9] iio: buffer-dmaengine: Use dma_slave_caps bus width accessors Nuno Sá
2026-10-09 15:52 ` [PATCH v5 7/9] ALSA: pcm_dmaengine: Use dma_slave_caps bus width helpers Nuno Sá
2026-10-09 15:53 ` [PATCH v5 8/9] spi: dw: " Nuno Sá
2026-10-09 15:53 ` [PATCH v5 9/9] 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®