Re: [PATCH 09/12] dmaengine: dw-edma-pcie: Add register offset match flag

From: Koichiro Den

Date: Fri May 22 2026 - 11:04:09 EST


On Thu, May 21, 2026 at 12:17:21PM -0400, Frank Li wrote:
> On Thu, May 21, 2026 at 03:31:12PM +0900, Koichiro Den wrote:
> > Add a match-data flag for devices whose DMA register block starts at an
> > offset inside the mapped BAR. Existing Synopsys EDDA and AMD/Xilinx MDB
> > matches keep using the BAR mapping base directly.
> >
> > No functional change intended.
> >
> > Signed-off-by: Koichiro Den <den@xxxxxxxxxxxxx>
> > ---
> > drivers/dma/dw-edma/dw-edma-pcie.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/dma/dw-edma/dw-edma-pcie.c b/drivers/dma/dw-edma/dw-edma-pcie.c
> > index 651269708cc5..6b375a58c550 100644
> > --- a/drivers/dma/dw-edma/dw-edma-pcie.c
> > +++ b/drivers/dma/dw-edma/dw-edma-pcie.c
> > @@ -88,6 +88,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)
> > +#define DW_EDMA_PCIE_F_REG_OFFSET BIT(2)
> >
> > static const struct dw_edma_pcie_data snps_edda_data = {
> > /* eDMA registers location */
> > @@ -450,6 +451,8 @@ static int dw_edma_pcie_probe(struct pci_dev *pdev,
> > chip->reg_base = pcim_iomap_table(pdev)[dma_data->rg.bar];
> > if (!chip->reg_base)
> > return -ENOMEM;
> > + if (match->flags & DW_EDMA_PCIE_F_REG_OFFSET)
> > + chip->reg_base += dma_data->rg.off;
>
> suppose default rg.off is 0, so needn't flag DW_EDMA_PCIE_F_REG_OFFSET.

As I understand it, for the existing EDDA/MDB paths, rg.off is not applied to
chip->reg_base. The static data has rg.off = 4K, and VSEC parsing may update it,
but the driver still uses the BAR mapping base directly as chip->reg_base.

So adding rg.off unconditionally would be a functional change for those existing
devices. That's why I added the flag. Am I missing something?

Best regards,
Koichiro

>
> Frank
>
> >
> > for (i = 0; i < chip->ll_wr_cnt && !non_ll; i++) {
> > struct dw_edma_region *ll_region = &chip->ll_region_wr[i];
> > --
> > 2.51.0
> >