Re: [PATCH 08/12] dmaengine: dw-edma-pcie: Add raw slave address match flag

From: Koichiro Den

Date: Fri May 22 2026 - 10:54:14 EST


On Thu, May 21, 2026 at 12:15:57PM -0400, Frank Li wrote:
> On Thu, May 21, 2026 at 03:31:11PM +0900, Koichiro Den wrote:
> > Add a match-data flag for devices whose DMA slave address is already in
> > the DMA controller address domain. Such devices do not need the
> > dw-edma-pcie pci_address callback, which translates a CPU MMIO address
> > back to a PCI bus address.
> >
> > When the flag is set, select platform ops without a pci_address callback
> > so dw-edma core passes the slave address through unchanged.
> >
> > No functional change intended. Existing matches do not set the new flag
> > and continue to use dw_edma_pcie_address().
> >
> > Signed-off-by: Koichiro Den <den@xxxxxxxxxxxxx>
> > ---
> > drivers/dma/dw-edma/dw-edma-pcie.c | 8 +++++++-
> > 1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/dma/dw-edma/dw-edma-pcie.c b/drivers/dma/dw-edma/dw-edma-pcie.c
> > index cf2f09f1891c..651269708cc5 100644
> > --- a/drivers/dma/dw-edma/dw-edma-pcie.c
> > +++ b/drivers/dma/dw-edma/dw-edma-pcie.c
> > @@ -87,6 +87,7 @@ struct dw_edma_pcie_match_data {
> > };
> >
> > #define DW_EDMA_PCIE_F_DEVMEM_PHYS_OFF BIT(0)
> > +#define DW_EDMA_PCIE_F_RAW_SLAVE_ADDR BIT(1)
> >
> > static const struct dw_edma_pcie_data snps_edda_data = {
> > /* eDMA registers location */
> > @@ -208,6 +209,10 @@ static const struct dw_edma_plat_ops dw_edma_pcie_plat_ops = {
> > .pci_address = dw_edma_pcie_address,
> > };
> >
> > +static const struct dw_edma_plat_ops dw_edma_pcie_raw_addr_plat_ops = {
> > + .irq_vector = dw_edma_pcie_irq_vector,
> > +};
> > +
> > static void dw_edma_pcie_get_synopsys_dma_data(struct pci_dev *pdev,
> > struct dw_edma_pcie_data *pdata)
> > {
> > @@ -435,7 +440,8 @@ static int dw_edma_pcie_probe(struct pci_dev *pdev,
> > chip->mf = dma_data->mf;
> > chip->default_irq_mode = match->default_irq_mode;
> > chip->nr_irqs = nr_irqs;
> > - chip->ops = &dw_edma_pcie_plat_ops;
> > + chip->ops = match->flags & DW_EDMA_PCIE_F_RAW_SLAVE_ADDR ?
> > + &dw_edma_pcie_raw_addr_plat_ops : &dw_edma_pcie_plat_ops;
>
> Can we direct put &dw_edma_pcie_raw_addr_plat_ops and &dw_edma_pcie_plat_ops
> into match data, so needn't flags DW_EDMA_PCIE_F_RAW_SLAVE_ADDR

Yes, I agree that makes the code cleaner. I'll do so in v2.
Thanks for the suggestion.

Best regards,
Koichiro

>
> Frank
> > chip->cfg_non_ll = non_ll;
> >
> > chip->ll_wr_cnt = dma_data->wr_ch_cnt;
> > --
> > 2.51.0
> >