Skip to content

Commit 4545c6a

Browse files
author
Marc Zyngier
committed
powerpc/msi: Fix deassociation of MSI descriptors
Since 2f2940d ("genirq/msi: Remove filter from msi_free_descs_free_range()"), the core MSI code relies on the msi_desc->irq field to have been cleared before the descriptor can be freed, as it indicates that there is no association with a device anymore. The irq domain code provides this guarantee, and so does s390, which is one of the two architectures not using irq domains for MSIs. Powerpc, however, is missing this particular requirements, leading in a splat and leaked MSI descriptors. Adding the now required irq reset to the handful of powerpc backends that implement MSIs fixes that particular problem. Reported-by: Guenter Roeck <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e982ad8 commit 4545c6a

File tree

5 files changed

+5
-0
lines changed

5 files changed

+5
-0
lines changed

arch/powerpc/platforms/4xx/hsta_msi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ static void hsta_teardown_msi_irqs(struct pci_dev *dev)
115115
msi_bitmap_free_hwirqs(&ppc4xx_hsta_msi.bmp, irq, 1);
116116
pr_debug("%s: Teardown IRQ %u (index %u)\n", __func__,
117117
entry->irq, irq);
118+
entry->irq = 0;
118119
}
119120
}
120121

arch/powerpc/platforms/cell/axon_msi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ static void axon_msi_teardown_msi_irqs(struct pci_dev *dev)
289289
msi_for_each_desc(entry, &dev->dev, MSI_DESC_ASSOCIATED) {
290290
irq_set_msi_desc(entry->irq, NULL);
291291
irq_dispose_mapping(entry->irq);
292+
entry->irq = 0;
292293
}
293294
}
294295

arch/powerpc/platforms/pasemi/msi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev)
6666
hwirq = virq_to_hw(entry->irq);
6767
irq_set_msi_desc(entry->irq, NULL);
6868
irq_dispose_mapping(entry->irq);
69+
entry->irq = 0;
6970
msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, ALLOC_CHUNK);
7071
}
7172
}

arch/powerpc/sysdev/fsl_msi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ static void fsl_teardown_msi_irqs(struct pci_dev *pdev)
132132
msi_data = irq_get_chip_data(entry->irq);
133133
irq_set_msi_desc(entry->irq, NULL);
134134
irq_dispose_mapping(entry->irq);
135+
entry->irq = 0;
135136
msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1);
136137
}
137138
}

arch/powerpc/sysdev/mpic_u3msi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ static void u3msi_teardown_msi_irqs(struct pci_dev *pdev)
108108
hwirq = virq_to_hw(entry->irq);
109109
irq_set_msi_desc(entry->irq, NULL);
110110
irq_dispose_mapping(entry->irq);
111+
entry->irq = 0;
111112
msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, 1);
112113
}
113114
}

0 commit comments

Comments
 (0)