lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260114-dma_common_config-v1-0-64feb836ff04@nxp.com>
Date: Wed, 14 Jan 2026 12:12:41 -0500
From: Frank Li <Frank.Li@....com>
To: Vinod Koul <vkoul@...nel.org>, Shawn Guo <shawnguo@...nel.org>, 
 Sascha Hauer <s.hauer@...gutronix.de>, 
 Pengutronix Kernel Team <kernel@...gutronix.de>, 
 Fabio Estevam <festevam@...il.com>
Cc: dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org, 
 imx@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org, 
 Frank Li <Frank.Li@....com>
Subject: [PATCH 0/6] dmaengine: Add common dma_slave_config and split it
 into src and dst parts

Many DMA engine drivers store a dma_slave_config per channel. Propagate
this configuration into struct dma_chan to avoid duplicating the same
code in each driver.

Much of dma_slave_config is identical for source and destination. Split
the configuration into src and dst groups and use a union to preserve
backward compatibility. This reduces the need for drivers to repeatedly
check the DMA transfer direction.

This change introduces the general approach. If this method is accepted,
more drivers can be updated incrementally.

Looking ahead, this also enables improvements to the vchan
implementation. Most DMA engines follow one of two descriptor models:

  - Cyclic hardware buffers (e.g. dw-edma)
  - Linked-list descriptors (e.g. fsl-edma)

 *
 *       ┌──────┐    ┌──────┐    ┌──────┐
 *       │      │ ┌─►│      │ ┌─►│      │
 *       │      │ │  │      │ │  │      │
 *       ├──────┤ │  ├──────┤ │  ├──────┤
 *       │ Next ├─┘  │ Next ├─┘  │ Next │
 *       └──────┘    └──────┘    └──────┘

A large portion of the software logic is shared between these models.
Recent work already shares circular buffer handling between eDMA and
HDMA [1], and this can be extended to support more hardware.

Ultimately, a DMA engine should only need to implement logic to fill a
single list item.

[1] https://lore.kernel.org/dmaengine/aWTyGpGN6WqtVCfN@ryzen/T/#t

Signed-off-by: Frank Li <Frank.Li@....com>
---
Frank Li (6):
      dmaengine: Move struct dma_chan after struct dma_slave_config
      dmaengine: Add common slave configuration to dma_chan
      dmaengine: fsl-edma: use dma_chan common config
      dmaengine: imx-sdma: use common config at dma_chan
      dmaengine: Add union and dma_slave_get_config() helper for dma_slave_config
      dmaengine: fsl-edma: use common dma_slave_get_cfg()

 drivers/dma/fsl-edma-common.c | 141 +++++++++++++++++------------------
 drivers/dma/fsl-edma-common.h |   1 -
 drivers/dma/imx-sdma.c        |   8 +-
 include/linux/dmaengine.h     | 166 +++++++++++++++++++++++++-----------------
 4 files changed, 166 insertions(+), 150 deletions(-)
---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20260112-dma_common_config-cb87b461296f

Best regards,
--
Frank Li <Frank.Li@....com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ