* [PATCH 1/2] PCI: dwc: Cleanup dw_pcie_edma_irq_verify()
@ 2025-09-08 16:59 Niklas Cassel
2025-09-08 16:59 ` [PATCH 2/2] PCI: qcom-ep: Remove redundant edma.nr_irqs initialization Niklas Cassel
2025-09-11 17:51 ` [PATCH 1/2] PCI: dwc: Cleanup dw_pcie_edma_irq_verify() Manivannan Sadhasivam
0 siblings, 2 replies; 3+ messages in thread
From: Niklas Cassel @ 2025-09-08 16:59 UTC (permalink / raw)
To: Jingoo Han, Manivannan Sadhasivam, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas
Cc: Shin'ichiro Kawasaki, Niklas Cassel, linux-pci
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.
Signed-off-by: Niklas Cassel <cassel@kernel.org>
---
drivers/pci/controller/dwc/pcie-designware.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c
index 89aad5a08928c..c7a2cf5e886f3 100644
--- a/drivers/pci/controller/dwc/pcie-designware.c
+++ b/drivers/pci/controller/dwc/pcie-designware.c
@@ -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");
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] PCI: qcom-ep: Remove redundant edma.nr_irqs initialization
2025-09-08 16:59 [PATCH 1/2] PCI: dwc: Cleanup dw_pcie_edma_irq_verify() Niklas Cassel
@ 2025-09-08 16:59 ` Niklas Cassel
2025-09-11 17:51 ` [PATCH 1/2] PCI: dwc: Cleanup dw_pcie_edma_irq_verify() Manivannan Sadhasivam
1 sibling, 0 replies; 3+ messages in thread
From: Niklas Cassel @ 2025-09-08 16:59 UTC (permalink / raw)
To: Manivannan Sadhasivam, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas
Cc: Shin'ichiro Kawasaki, Niklas Cassel, linux-pci, linux-arm-msm
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.
Signed-off-by: Niklas Cassel <cassel@kernel.org>
---
drivers/pci/controller/dwc/pcie-qcom-ep.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/controller/dwc/pcie-qcom-ep.c
index bf7c6ac0f3e39..ad98598bb5228 100644
--- a/drivers/pci/controller/dwc/pcie-qcom-ep.c
+++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c
@@ -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) {
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] PCI: dwc: Cleanup dw_pcie_edma_irq_verify()
2025-09-08 16:59 [PATCH 1/2] PCI: dwc: Cleanup dw_pcie_edma_irq_verify() Niklas Cassel
2025-09-08 16:59 ` [PATCH 2/2] PCI: qcom-ep: Remove redundant edma.nr_irqs initialization Niklas Cassel
@ 2025-09-11 17:51 ` Manivannan Sadhasivam
1 sibling, 0 replies; 3+ messages in thread
From: Manivannan Sadhasivam @ 2025-09-11 17:51 UTC (permalink / raw)
To: Jingoo Han, Lorenzo Pieralisi, Krzysztof Wilczyński,
Rob Herring, Bjorn Helgaas, Niklas Cassel
Cc: Shin'ichiro Kawasaki, linux-pci
On Mon, 08 Sep 2025 18:59:15 +0200, Niklas Cassel wrote:
> 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,
--
Manivannan Sadhasivam <mani@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-09-11 17:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-08 16:59 [PATCH 1/2] PCI: dwc: Cleanup dw_pcie_edma_irq_verify() Niklas Cassel
2025-09-08 16:59 ` [PATCH 2/2] PCI: qcom-ep: Remove redundant edma.nr_irqs initialization Niklas Cassel
2025-09-11 17:51 ` [PATCH 1/2] PCI: dwc: Cleanup dw_pcie_edma_irq_verify() Manivannan Sadhasivam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox