Skip to contentSkip to conversation

hw/pci-bridge/pxb: Fix missing swizzle

PATCH In review Jonathan Cameron via 1 participant 2 messages Jan 18, 2022 – Feb 17, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/pci-bridge/pxb: Fix missing swizzle

From: Jonathan Cameron <[email protected]>

pxb_map_irq_fn() handled the necessary removal of the swizzle applied to the PXB interrupts by the bus to which it was attached but neglected to apply the normal swizzle for PCI root ports on the expander bridge.

Result of this was on ARM virt, the PME interrupts for a second RP on a PXB instance were miss-routed to #45 rather than #46.

Tested with a selection of different configurations with 1 to 5 RP per PXB instance. Note on my x86 test setup the PME interrupts are not triggered so I haven't been able to test this.

Cc Michael S. Tsirkin <[email protected]>
Cc Marcel Apfelbaum <[email protected]>
---
 hw/pci-bridge/pci_expander_bridge.c | 6 ++++++
 1 file changed, 6 insertions(+)
hw/pci-bridge/pci_expander_bridge.c +6 -0
index 10e6e7c2ab..de932286b5 100644
@@ -192,6 +192,12 @@ static int pxb_map_irq_fn(PCIDevice *pci_dev, int pin)
 {
     PCIDevice *pxb = pci_get_bus(pci_dev)->parent_dev;
 
+    /*
+     * First carry out normal swizzle to handle
+     * multple root ports on a pxb instance.
+     */
+    pin = pci_swizzle_map_irq_fn(pci_dev, pin);
+
     /*
      * The bios does not index the pxb slot number when
      * it computes the IRQ because it resides on bus 0
Signature · 1 line
2.32.0
#1 lore raw
Quoted 10 lines · On Tue, 18 Jan 2022 17:48:55 +0000 Jonathan Cameron via…

From: Jonathan Cameron <[email protected]>

pxb_map_irq_fn() handled the necessary removal of the swizzle applied to the PXB interrupts by the bus to which it was attached but neglected to apply the normal swizzle for PCI root ports on the expander bridge.

Result of this was on ARM virt, the PME interrupts for a second RP on a PXB instance were miss-routed to #45 rather than #46.

Quoted 7 lines

Tested with a selection of different configurations with 1 to 5 RP per PXB instance. Note on my x86 test setup the PME interrupts are not triggered so I haven't been able to test this.

Cc Michael S. Tsirkin <[email protected]>
Cc Marcel Apfelbaum <[email protected]>

Ping.

Quoted 21 lines
---
 hw/pci-bridge/pci_expander_bridge.c | 6 ++++++
 1 file changed, 6 insertions(+)
hw/pci-bridge/pci_expander_bridge.c +6 -0
index 10e6e7c2ab..de932286b5 100644
@@ -192,6 +192,12 @@ static int pxb_map_irq_fn(PCIDevice *pci_dev, int pin)
 {
     PCIDevice *pxb = pci_get_bus(pci_dev)->parent_dev;
 
+    /*
+     * First carry out normal swizzle to handle
+     * multple root ports on a pxb instance.
+     */
+    pin = pci_swizzle_map_irq_fn(pci_dev, pin);
+
     /*
      * The bios does not index the pxb slot number when
      * it computes the IRQ because it resides on bus 0