]> www.infradead.org Git - users/hch/misc.git/commitdiff
PCI: dwc: Verify the single eDMA IRQ in dw_pcie_edma_irq_verify()
authorNiklas Cassel <cassel@kernel.org>
Mon, 8 Sep 2025 16:59:15 +0000 (18:59 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 12 Sep 2025 21:51:57 +0000 (16:51 -0500)
dw_pcie_edma_irq_verify() is supposed to verify the eDMA IRQs in devicetree
by fetching them using either 'dma' or 'dmaX' IRQ names. Former is used
when the platform uses a single IRQ for all eDMA channels and latter is
used when the platform uses separate IRQ per channel. But currently,
dw_pcie_edma_irq_verify() bails out early if edma::nr_irqs is 1, i.e., when
a single IRQ is used. This gives an impression that the driver could work
with any single IRQ in devicetree, not necessarily with name 'dma'.

But dw_pcie_edma_irq_vector(), which actually requests the IRQ, does
require the single IRQ to be named as 'dma'. So this creates inconsistency
between dw_pcie_edma_irq_verify() and dw_pcie_edma_irq_vector().

Thus, to fix this inconsistency, make sure dw_pcie_edma_irq_verify() also
verifies the single IRQ name by removing the bail out code.

Signed-off-by: Niklas Cassel <cassel@kernel.org>
[mani: reworded subject and description]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
[bhelgaas: fix typos]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20250908165914.547002-3-cassel@kernel.org
drivers/pci/controller/dwc/pcie-designware.c

index 89aad5a08928cc29870ab258d33bee9ff8f83143..c7a2cf5e886f372c82d047c37fa2c5aa424326f3 100644 (file)
@@ -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");