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 <[email protected]>
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/[email protected]?part=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.