Skip to contentSkip to conversation

pcie-xilinx: OF-PCIe numbers legacy interrupts from 1

PATCH In review Palmer Dabbelt 2 participants 2 messages Jun 23, 2017 – Jul 12, 2017

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

PATCH 1/1 pcie-xilinx: OF-PCIe numbers legacy interrupts from 1

From: "Wesley W. Terpstra" <[email protected]>

Without this patch we can't use the 4th legacy PCIe interrupt. This is a workaround: there are only 4 legacy interrupts, but since they're numbered starting from 1 instead of 0 this just adds a 5th interrupt.

---
 drivers/pci/host/pcie-xilinx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/host/pcie-xilinx.c +2 -2
index 2fe2df51f9f8..8804145d399a 100644
@@ -443,7 +443,7 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)
 			val = ((val & XILINX_PCIE_RPIFR1_INTR_MASK) >>
 				XILINX_PCIE_RPIFR1_INTR_SHIFT) + 1;
 			generic_handle_irq(irq_find_mapping(port->leg_domain,
-							    val));
+							    val + 1));
 		}
 	}
 
@@ -524,7 +524,7 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port)
 		return -ENODEV;
 	}
 
-	port->leg_domain = irq_domain_add_linear(pcie_intc_node, 4,
+	port->leg_domain = irq_domain_add_linear(pcie_intc_node, 5,
 						 &intx_domain_ops,
 						 port);
 	if (!port->leg_domain) {
Signature · 1 line
2.13.0
#1 lore raw

[+cc Paul]

Quoted 8 lines · Palmer Dabbelt

From: "Wesley W. Terpstra" <[email protected]>

Without this patch we can't use the 4th legacy PCIe interrupt. This is a workaround: there are only 4 legacy interrupts, but since they're numbered starting from 1 instead of 0 this just adds a 5th interrupt.

This is a duplicate of Paul Burton's patch, which we're still puzzling over here:

http://lkml.kernel.org/r/[email protected]

If you have comments, please chime in on that discussion so it's not fragmented between two threads.

Quoted 29 lines
---
 drivers/pci/host/pcie-xilinx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/host/pcie-xilinx.c +2 -2
index 2fe2df51f9f8..8804145d399a 100644
@@ -443,7 +443,7 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)
 			val = ((val & XILINX_PCIE_RPIFR1_INTR_MASK) >>
 				XILINX_PCIE_RPIFR1_INTR_SHIFT) + 1;
 			generic_handle_irq(irq_find_mapping(port->leg_domain,
-							    val));
+							    val + 1));
 		}
 	}
 
@@ -524,7 +524,7 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port)
 		return -ENODEV;
 	}
 
-	port->leg_domain = irq_domain_add_linear(pcie_intc_node, 4,
+	port->leg_domain = irq_domain_add_linear(pcie_intc_node, 5,
 						 &intx_domain_ops,
 						 port);
 	if (!port->leg_domain) {
Signature · 1 line
2.13.0