Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH v2] PCI: pcie-xilinx-dma-pl: Fix off-by-one INTx IRQ handling
@ 2025-10-21 15:43 Stefan Roese
  2025-10-21 15:53 ` Bjorn Helgaas
  2025-10-21 17:30 ` Sean Anderson
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Roese @ 2025-10-21 15:43 UTC (permalink / raw)
  To: linux-pci
  Cc: Sean Anderson, Manivannan Sadhasivam, Ravi Kumar Bandi,
	Thippeswamy Havalige, Michal Simek, Bjorn Helgaas

While testing with NVMe drives connected to the Versal QDMA PL PCIe RP
on our platform I noticed that with MSI disabled (e.g. via pci=nomsi)
the NVMe interrupts are not delivered to the host CPU resulting in
timeouts while probing.

Debugging has shown, that the hwirq numbers passed to this device driver
(1...4, 1=INTA etc) need to get adjusted to match the numbers in the
controller registers bits (0...3).

This patch now adds pci_irqd_intx_xlate to the INTx IRQ domain ops,
handling this IRQ number translation correctly.

Signed-off-by: Stefan Roese <stefan.roese@mailbox.org>
Cc: Sean Anderson <sean.anderson@linux.dev>
Cc: Manivannan Sadhasivam <mani@kernel.org>
Cc: Ravi Kumar Bandi <ravib@amazon.com>
Cc: Thippeswamy Havalige <thippeswamy.havalige@amd.com>
Cc: Michal Simek <michal.simek@amd.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
---
v2:
- Use pci_irqd_intx_xlate to handle this IRQ number translation as suggested
  by Sean (thanks again)

 drivers/pci/controller/pcie-xilinx-dma-pl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/controller/pcie-xilinx-dma-pl.c b/drivers/pci/controller/pcie-xilinx-dma-pl.c
index 84888eda990b2..80095457ec531 100644
--- a/drivers/pci/controller/pcie-xilinx-dma-pl.c
+++ b/drivers/pci/controller/pcie-xilinx-dma-pl.c
@@ -370,6 +370,7 @@ static int xilinx_pl_dma_pcie_intx_map(struct irq_domain *domain,
 /* INTx IRQ Domain operations */
 static const struct irq_domain_ops intx_domain_ops = {
 	.map = xilinx_pl_dma_pcie_intx_map,
+	.xlate = pci_irqd_intx_xlate,
 };
 
 static irqreturn_t xilinx_pl_dma_pcie_msi_handler_high(int irq, void *args)
-- 
2.51.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-10-21 17:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-21 15:43 [PATCH v2] PCI: pcie-xilinx-dma-pl: Fix off-by-one INTx IRQ handling Stefan Roese
2025-10-21 15:53 ` Bjorn Helgaas
2025-10-21 16:02   ` Stefan Roese
2025-10-21 16:15     ` Bjorn Helgaas
2025-10-21 16:26   ` Sean Anderson
2025-10-21 17:30 ` Sean Anderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox