From: Frank Li <Frank.li@nxp.com>
To: Koichiro Den <den@valinux.co.jp>
Cc: Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
Manivannan Sadhasivam <mani@kernel.org>,
Marek Vasut <marek.vasut+renesas@mailbox.org>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 05/12] dmaengine: dw-edma-pcie: Add capability match data
Date: Thu, 21 May 2026 12:06:48 -0400 [thread overview]
Message-ID: <ag8tmGfsYbWVi6NC@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20260521063115.2842238-6-den@valinux.co.jp>
On Thu, May 21, 2026 at 03:31:08PM +0900, Koichiro Den wrote:
> Move device-specific capability parsing behind per-device match data.
>
> The existing probe path mixes two decisions: which static template a PCI
> ID uses, and which device-specific capability parser adjusts that
> template. Split those decisions so device-specific discovery can be
> added through match data instead of adding more vendor checks to
> dw_edma_pcie_probe().
>
> No functional change is intended for the existing Synopsys EDDA and
> AMD/Xilinx MDB matches. They still copy the same static template data and
> run the same capability parsing logic before BAR mapping. The MDB entry
> also keeps using endpoint memory physical addresses for descriptor
> windows through a new match-data flag.
>
> Signed-off-by: Koichiro Den <den@valinux.co.jp>
> ---
> drivers/dma/dw-edma/dw-edma-pcie.c | 127 +++++++++++++++++++----------
> 1 file changed, 85 insertions(+), 42 deletions(-)
>
> diff --git a/drivers/dma/dw-edma/dw-edma-pcie.c b/drivers/dma/dw-edma/dw-edma-pcie.c
> index 0b30ce138503..043a7f73bf79 100644
> --- a/drivers/dma/dw-edma/dw-edma-pcie.c
> +++ b/drivers/dma/dw-edma/dw-edma-pcie.c
> @@ -74,6 +74,19 @@ struct dw_edma_pcie_data {
> u64 devmem_phys_off;
> };
>
> +struct dw_edma_pcie_match_data {
> + const struct dw_edma_pcie_data *data;
> + /*
> + * Mandatory callback. It may leave @pdata unchanged when the static
> + * template already describes the device.
> + */
> + int (*parse_caps)(struct pci_dev *pdev,
> + struct dw_edma_pcie_data *pdata, bool *non_ll);
Needn't non_ll here. This information should be already save into
dw_edma_chip::cfg_no_ll
> + unsigned long flags;
> +};
...
>
> +static const struct dw_edma_pcie_match_data snps_edda_match_data = {
> + .data = &snps_edda_data,
> + .parse_caps = dw_edma_pcie_parse_synopsys_caps,
> +};
> +
> +static const struct dw_edma_pcie_match_data xilinx_mdb_match_data = {
> + .data = &xilinx_mdb_data,
> + .parse_caps = dw_edma_pcie_parse_xilinx_caps,
> + .flags = DW_EDMA_PCIE_F_DEVMEM_PHYS_OFF,
> +};
> +
> static const struct pci_device_id dw_edma_pcie_id_table[] = {
> - { PCI_DEVICE_DATA(SYNOPSYS, EDDA, &snps_edda_data) },
> + { PCI_DEVICE_DATA(SYNOPSYS, EDDA, &snps_edda_match_data) },
> { PCI_VDEVICE(XILINX, PCI_DEVICE_ID_XILINX_B054),
> - (kernel_ulong_t)&xilinx_mdb_data },
> + (kernel_ulong_t)&xilinx_mdb_match_data },
On going thread
https://lore.kernel.org/linux-i3c/afmEo54iWgk54M3Y@monoceros/
.driver_data = (kernel_ulong_t)&xilinx_mdb_data;
> { }
> };
> MODULE_DEVICE_TABLE(pci, dw_edma_pcie_id_table);
> --
> 2.51.0
>
next prev parent reply other threads:[~2026-05-21 16:06 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 6:31 [PATCH 00/12] dmaengine: dw-edma: Prepare for PCI EP DMA (part 1/3) Koichiro Den
2026-05-21 6:31 ` [PATCH 01/12] dmaengine: Make dma_get_slave_channel() public Koichiro Den
2026-05-21 6:31 ` [PATCH 02/12] dmaengine: dw-edma: Add channel lookup helper Koichiro Den
2026-05-21 15:50 ` Frank Li
2026-05-21 6:31 ` [PATCH 03/12] dmaengine: dw-edma: Add per-channel interrupt routing control Koichiro Den
2026-05-21 6:31 ` [PATCH 04/12] dmaengine: dw-edma: Add partial channel ownership mode Koichiro Den
2026-05-21 6:31 ` [PATCH 05/12] dmaengine: dw-edma-pcie: Add capability match data Koichiro Den
2026-05-21 16:06 ` Frank Li [this message]
2026-05-22 14:38 ` Koichiro Den
2026-05-22 20:54 ` Frank Li
2026-05-21 6:31 ` [PATCH 06/12] dmaengine: dw-edma-pcie: Rename DMA data copy Koichiro Den
2026-05-21 16:10 ` Frank Li
2026-05-22 14:41 ` Koichiro Den
2026-05-21 6:31 ` [PATCH 07/12] dmaengine: dw-edma-pcie: Add default IRQ match data Koichiro Den
2026-05-21 16:12 ` Frank Li
2026-05-21 6:31 ` [PATCH 08/12] dmaengine: dw-edma-pcie: Add raw slave address match flag Koichiro Den
2026-05-21 16:15 ` Frank Li
2026-05-22 14:45 ` Koichiro Den
2026-05-21 6:31 ` [PATCH 09/12] dmaengine: dw-edma-pcie: Add register offset " Koichiro Den
2026-05-21 16:17 ` Frank Li
2026-05-22 14:57 ` Koichiro Den
2026-05-22 20:51 ` Frank Li
2026-05-21 6:31 ` [PATCH 10/12] dmaengine: dw-edma-pcie: Factor descriptor block addresses Koichiro Den
2026-05-21 16:21 ` Frank Li
2026-05-21 6:31 ` [PATCH 11/12] dmaengine: dw-edma-pcie: Handle optional data blocks Koichiro Den
2026-05-21 16:25 ` Frank Li
2026-05-21 6:31 ` [PATCH 12/12] dmaengine: dw-edma-pcie: Add chip flags match data Koichiro Den
2026-05-21 16:26 ` Frank Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ag8tmGfsYbWVi6NC@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=Frank.Li@kernel.org \
--cc=den@valinux.co.jp \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mani@kernel.org \
--cc=marek.vasut+renesas@mailbox.org \
--cc=vkoul@kernel.org \
--cc=yoshihiro.shimoda.uh@renesas.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®