DMA Engine development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Devendra K Verma" <devverma@amd.com>
Cc: linux-pci@vger.kernel.org, vkoul@kernel.org,
	dmaengine@vger.kernel.org, Frank.Li@kernel.org
Subject: Re: [PATCH v5 1/2] dmaengine: dw-edma: Enable Chan Separation via VSEC
Date: Thu, 20 Aug 2026 09:18:24 +0000	[thread overview]
Message-ID: <20260820091824.AC9A41F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260820091025.683506-2-devverma@amd.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Failing to call pci_free_irq_vectors() in error paths after successful pci_alloc_irq_vectors() leaks IRQ resources.
--

--- Patch [1]: [PATCH v5 1/2] dmaengine: dw-edma: Enable Chan Separation via VSEC ---
commit 53282250df52af0d427cd82b37ad2ac609096030
Author: Devendra K Verma <devverma@amd.com>

dmaengine: dw-edma: Enable Chan Separation via VSEC

This commit enables channel separation mechanisms for the HDMA IP by
retrieving the configuration via the DEVICE INFORMATION VSEC capability.
It adds support for channel register space separation sizing.

> diff --git a/drivers/dma/dw-edma/dw-edma-pcie.c b/drivers/dma/dw-edma/dw-edma-pcie.c
> index 791c46e8ae4c4..f287879b2cb9e 100644
> --- a/drivers/dma/dw-edma/dw-edma-pcie.c
> +++ b/drivers/dma/dw-edma/dw-edma-pcie.c

[ ... ]

> @@ -279,6 +289,10 @@ static void dw_edma_pcie_get_xilinx_dma_data(struct pci_dev *pdev,
>  	pdata->mf = map;
>  	pdata->rg.bar = FIELD_GET(DW_PCIE_XILINX_MDB_VSEC_DMA_BAR, val);
>  
> +	if (pdev->device == PCI_DEVICE_ID_XILINX_B00F)
> +		pdata->ch_space_sz = dw_edma_get_ch_space_sz
> +					(FIELD_GET(DW_PCIE_XILINX_CPM6_VSEC_CH_SEP, val));
> +
>  	pci_read_config_dword(pdev, vsec + 0xc, &val);
>  	pdata->wr_ch_cnt = min(pdata->wr_ch_cnt,
>  			       FIELD_GET(DW_PCIE_XILINX_MDB_VSEC_DMA_WR_CH, val));

[Severity: High]
This is a pre-existing issue, but does dw_edma_pcie_probe() leak system
IRQ capacity in its error handling paths?

Looking at dw_edma_pcie_probe() in the same file, if pci_alloc_irq_vectors()
succeeds, several subsequent error paths appear to return directly without
cleaning up the allocated vectors:

drivers/dma/dw-edma/dw-edma-pcie.c:dw_edma_pcie_probe() {
    ...
    /* IRQs allocation */
    nr_irqs = pci_alloc_irq_vectors(pdev, 1, vsec_data->irqs,
                                    PCI_IRQ_MSI | PCI_IRQ_MSIX);
    ...
    chip->reg_base = pcim_iomap_table(pdev)[vsec_data->rg.bar];
    if (!chip->reg_base)
            return -ENOMEM;
    ...
    /* Starting eDMA driver */
    err = dw_edma_probe(chip);
    if (err) {
            pci_err(pdev, "eDMA probe failed\n");
            return err;
    }
    ...
}

Should these failure paths explicitly call pci_free_irq_vectors() before
returning to avoid leaking the IRQ resources?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260820091025.683506-1-devverma@amd.com?part=1

  reply	other threads:[~2026-08-20  9:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20  9:10 [PATCH v5 0/2] CPM6 Channel Separation Support Devendra K Verma
2026-08-20  9:10 ` [PATCH v5 1/2] dmaengine: dw-edma: Enable Chan Separation via VSEC Devendra K Verma
2026-08-20  9:18   ` sashiko-bot [this message]
2026-08-20  9:10 ` [PATCH v5 2/2] dmaengine: dw-edma: Add changes to support Channel Separation Devendra K Verma
2026-08-20  9:20   ` sashiko-bot
2026-08-20 15:22   ` 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=20260820091824.AC9A41F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=devverma@amd.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@kernel.org \
    /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