Re: [PATCH v3 01/11] dmaengine: Add hw_id to dma_slave_caps
From: Frank Li <Frank.li@nxp.com>
Date: 2026-02-04 19:39:15
Also in:
dmaengine, linux-pci
On Wed, Feb 04, 2026 at 11:54:29PM +0900, Koichiro Den wrote:
quoted hunk ↗ jump to hunk
Remote DMA users may need to map or otherwise correlate DMA resources on a per-hardware-channel basis (e.g. DWC EP eDMA linked-list windows). However, struct dma_chan does not expose a provider-defined hardware channel identifier. Add an optional dma_slave_caps.hw_id field to allow DMA engine drivers to report a provider-specific hardware channel identifier to clients. Initialize the field to -1 in dma_get_slave_caps() so drivers that do not populate it continue to behave as before. Signed-off-by: Koichiro Den <redacted> --- drivers/dma/dmaengine.c | 1 + include/linux/dmaengine.h | 2 ++ 2 files changed, 3 insertions(+)diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index ca13cd39330b..b544eb99359d 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c@@ -603,6 +603,7 @@ int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps) caps->cmd_pause = !!device->device_pause; caps->cmd_resume = !!device->device_resume; caps->cmd_terminate = !!device->device_terminate_all; + caps->hw_id = -1; /* * DMA engine device might be configured with non-uniformlydiff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 99efe2b9b4ea..71bc2674567f 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h@@ -507,6 +507,7 @@ enum dma_residue_granularity { * @residue_granularity: granularity of the reported transfer residue * @descriptor_reuse: if a descriptor can be reused by client and * resubmitted multiple times + * @hw_id: provider-specific hardware channel identifier (-1 if unknown) */ struct dma_slave_caps { u32 src_addr_widths;@@ -520,6 +521,7 @@ struct dma_slave_caps { bool cmd_terminate; enum dma_residue_granularity residue_granularity; bool descriptor_reuse; + int hw_id;
I have not see where use it? Does src_id of struct dma_chan work? Frank
}; static inline const char *dma_chan_name(struct dma_chan *chan) -- 2.51.0