summaryrefslogtreecommitdiff
path: root/include/linux/dma
diff options
context:
space:
mode:
authorKoichiro Den <den@valinux.co.jp>2026-07-21 15:28:15 +0900
committerVinod Koul <vkoul@kernel.org>2026-07-21 16:00:36 +0530
commit0613e7934ee233d726af8d8c89f251a1c4df738d (patch)
tree898c9cfd79eaafa4506bcf2ff366d1848199f281 /include/linux/dma
parent1d68178b3404737af2cee6c7b4395de3de6dccaa (diff)
dmaengine: dw-edma: Program endpoint function numbers
The eDMA/HDMA transfers the driver issues carry a requester function number in their TLPs, but nothing ever programs it: eDMA v0 leaves the FUNC_NUM field of the channel control word zero and HDMA leaves the per-channel func_num register at its reset value, so every transfer is attributed to function 0. That is invisible in single-function setups, but once the DMA block serves a non-zero endpoint function, its requests must carry that function's number for the host to attribute and translate them correctly. Record the function number in the chip data (PCI_FUNC() of the probing device for dw-edma-pcie) and program it per channel. Endpoint-local chip instances keep func_no at 0, so transfers issued by the endpoint-side driver remain PF0-attributed. Delegated channels are programmed by the host-side dw-edma-pcie instance when it takes over the channel, using that instance's PCI_FUNC(). Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Koichiro Den <den@valinux.co.jp> Link: https://patch.msgid.link/20260721062815.4117887-15-den@valinux.co.jp Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'include/linux/dma')
-rw-r--r--include/linux/dma/edma.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/dma/edma.h b/include/linux/dma/edma.h
index 2ce9d2d49aef..3c8e2ef9dee0 100644
--- a/include/linux/dma/edma.h
+++ b/include/linux/dma/edma.h
@@ -117,6 +117,7 @@ enum dw_edma_ch_irq_mode {
* @db_irq: Virtual IRQ dedicated to interrupt emulation
* @db_offset: Offset from DMA register base
* @mf: DMA register map format
+ * @func_no: PCI endpoint function number used by DMA TLPs
* @dw: struct dw_edma that is filled by dw_edma_probe()
*/
struct dw_edma_chip {
@@ -142,6 +143,7 @@ struct dw_edma_chip {
resource_size_t db_offset;
enum dw_edma_map_format mf;
+ u8 func_no;
struct dw_edma *dw;
bool cfg_non_ll;