[PATCH v2 00/12] dmaengine: dw-edma: Prepare for PCI EP DMA (part 1/3)

Koichiro Den posted 12 patches 2 weeks ago
drivers/dma/dw-edma/dw-edma-core.c    | 128 ++++++++++++--
drivers/dma/dw-edma/dw-edma-core.h    |  13 ++
drivers/dma/dw-edma/dw-edma-pcie.c    | 245 +++++++++++++++++---------
drivers/dma/dw-edma/dw-edma-v0-core.c |  22 ++-
include/linux/dma/edma.h              |  64 +++++++
5 files changed, 368 insertions(+), 104 deletions(-)
[PATCH v2 00/12] dmaengine: dw-edma: Prepare for PCI EP DMA (part 1/3)
Posted by Koichiro Den 2 weeks ago
Hi,

This is v2, part 1 of three series for PCI endpoint DMA.

The three series are:

  * part 1: dmaengine: dw-edma: Prepare for PCI EP DMA
  * part 2: PCI: endpoint: Expose endpoint DMA resources
  * part 3: PCI: endpoint: Add PCI DMA endpoint function

This first series contains the dmaengine and dw-edma groundwork needed
to let a PCI endpoint function delegate selected endpoint-integrated DMA
channels to a PCI host. It does not add the endpoint function itself.


Background
==========

I previously posted this RFC:

  [PATCH 00/15] PCI: endpoint: Remote DMA support via vNTB
  https://lore.kernel.org/linux-pci/20260312165005.1148676-1-den@valinux.co.jp/

That design exposed the endpoint-local PCIe DMA engine through
vNTB. This version moves the DMA engine into its own endpoint function
instead. The host then sees a DMA controller PCI function, and vNTB does
not need to carry a DMA-specific ABI.

The immediate motivation is NTB transport between a directly attached EP
and RC. The goal is to use the endpoint-local DMA engine and avoid the
extra CPU copy in both directions.


Scope
=====

This series:

  * adds a dw-edma dma_request_channel() filter for exact hardware channel
    claims,
  * adds per-channel interrupt routing control for delegated channels,
  * adds a partial channel ownership mode for delegated channel sets, and
  * prepares dw-edma-pcie to describe device-specific DMA layouts through
    match data.

The PCI endpoint metadata format, DesignWare endpoint resource exposure,
and the endpoint function driver are added by parts 2 and 3.


Dependencies
============

This series is based on dmaengine/next at:

  362ee0c0dc52 ("dmaengine: Move MODULE_DEVICE_TABLE next to the table itself")

Parts 2 and 3 depend on this series.


Note
====

Pre-existing dw-edma issues flagged by Sashiko during v1 review are
handled separately. See
https://lore.kernel.org/dmaengine/20260521142153.2957432-1-den@valinux.co.jp/


---
Changelog
=========

Changes in v2:
  - Move non-LL state and platform ops into match data. (Frank)
  - Use a named .driver_data initializer for the Xilinx MDB ID entry and
    fix the vsec_data rename patch title. (Frank)
  - Replace the dma_get_slave_channel() export with a dw-edma channel
    filter for dma_request_channel(). (Sashiko)
  - Rework the IRQ-routing config as dw_edma_irq_config, keep HDMA native
    int config separate, and reject remote IRQ mode on local instances.
    (Sashiko)
  - Report IRQ_HANDLED only for status that was actually serviced and drop
    the lockless free_chan_resources() reset. (Sashiko)
  - Tighten partial ownership: reject unsupported map formats early and
    require direction-wide ownership for supported shared-register
    layouts. (Sashiko)

v1: https://lore.kernel.org/dmaengine/20260521063115.2842238-1-den@valinux.co.jp/


Best regards,
Koichiro


Koichiro Den (12):
  dmaengine: dw-edma: Add hardware channel filter
  dmaengine: dw-edma: Add per-channel interrupt routing control
  dmaengine: dw-edma: Add partial channel ownership mode
  dmaengine: dw-edma-pcie: Track non-LL mode in DMA data
  dmaengine: dw-edma-pcie: Add capability match data
  dmaengine: dw-edma-pcie: Rename vsec_data to dma_data
  dmaengine: dw-edma-pcie: Add default IRQ mode to match data
  dmaengine: dw-edma-pcie: Add platform ops to match data
  dmaengine: dw-edma-pcie: Add register offset match flag
  dmaengine: dw-edma-pcie: Factor out descriptor block address lookup
  dmaengine: dw-edma-pcie: Handle optional data blocks
  dmaengine: dw-edma-pcie: Add chip flags to match data

 drivers/dma/dw-edma/dw-edma-core.c    | 128 ++++++++++++--
 drivers/dma/dw-edma/dw-edma-core.h    |  13 ++
 drivers/dma/dw-edma/dw-edma-pcie.c    | 245 +++++++++++++++++---------
 drivers/dma/dw-edma/dw-edma-v0-core.c |  22 ++-
 include/linux/dma/edma.h              |  64 +++++++
 5 files changed, 368 insertions(+), 104 deletions(-)

-- 
2.51.0