Skip to contentSkip to conversation

PCI: dwc: Cleanup dw_pcie_edma_irq_verify()

PATCH Applied Niklas Cassel 2 participants 3 messages Sep 8, 2025 – Sep 11, 2025

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 PCI: dwc: Cleanup dw_pcie_edma_irq_verify()

dw_pcie_edma_irq_vector() requires either "dma" (if there is a single IRQ for all DMA channels) or "dmaX" (if there is one IRQ per DMA channel) to be specified in device tree.

Thus, it does not make any sense for dw_pcie_edma_irq_verify() to have a looser requirement than dw_pcie_edma_irq_vector(). (Since both functions will get called during the probe of the eDMA driver. First dw_pcie_edma_irq_verify(), then dw_pcie_edma_irq_vector().)

Thus, remove this redundant code in dw_pcie_edma_irq_verify(), such that dw_pcie_edma_irq_verify() and dw_pcie_edma_irq_vector() have the same requirements.

---
 drivers/pci/controller/dwc/pcie-designware.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/pci/controller/dwc/pcie-designware.c +1 -3
index 89aad5a08928c..c7a2cf5e886f3 100644
@@ -1045,9 +1045,7 @@ static int dw_pcie_edma_irq_verify(struct dw_pcie *pci)
 	char name[15];
 	int ret;
 
-	if (pci->edma.nr_irqs == 1)
-		return 0;
-	else if (pci->edma.nr_irqs > 1)
+	if (pci->edma.nr_irqs > 1)
 		return pci->edma.nr_irqs != ch_cnt ? -EINVAL : 0;
 
 	ret = platform_get_irq_byname_optional(pdev, "dma");
Signature · 1 line
2.51.0
#1 lore raw

PATCH 2/2 PCI: qcom-ep: Remove redundant edma.nr_irqs initialization

dw_pcie_edma_irq_verify() already parses device tree for either "dma" (if there is a single IRQ for all DMA channels) or "dmaX" (if there is one IRQ per DMA channel), and initializes dma.nr_irqs accordingly.

Additionally, the probing of the eDMA driver will fail if neither "dma" nor "dmaX" is defined in the device tree.

There therefore no need for a glue driver to specify edma.nr_irqs. Thus, remove the redundant edma.nr_irqs initialization.

---
 drivers/pci/controller/dwc/pcie-qcom-ep.c | 1 -
 1 file changed, 1 deletion(-)
drivers/pci/controller/dwc/pcie-qcom-ep.c +0 -1
index bf7c6ac0f3e39..ad98598bb5228 100644
@@ -874,7 +874,6 @@ static int qcom_pcie_ep_probe(struct platform_device *pdev)
 	pcie_ep->pci.dev = dev;
 	pcie_ep->pci.ops = &pci_ops;
 	pcie_ep->pci.ep.ops = &pci_ep_ops;
-	pcie_ep->pci.edma.nr_irqs = 1;
 
 	pcie_ep->cfg = of_device_get_match_data(dev);
 	if (pcie_ep->cfg && pcie_ep->cfg->hdma_support) {
Signature · 1 line
2.51.0
maintainer Applied
#2 lore raw
In reply to Niklas Cassel
Quoted 10 lines · Niklas Cassel

dw_pcie_edma_irq_vector() requires either "dma" (if there is a single IRQ for all DMA channels) or "dmaX" (if there is one IRQ per DMA channel) to be specified in device tree.

Thus, it does not make any sense for dw_pcie_edma_irq_verify() to have a looser requirement than dw_pcie_edma_irq_vector(). (Since both functions will get called during the probe of the eDMA driver. First dw_pcie_edma_irq_verify(), then dw_pcie_edma_irq_vector().)

[...]

Applied, thanks!

[1/2] PCI: dwc: Cleanup dw_pcie_edma_irq_verify()

      commit: 35ddcfd49f1520a95db3aafdb5bd115e2fd075a4
[2/2] PCI: qcom-ep: Remove redundant edma.nr_irqs initialization
      commit: 9e495c2d7f38a6e256749a8466856dc711666f05

Best regards,

Signature · 1 line
Manivannan Sadhasivam <[email protected]>