diff options
author | 2022-12-17 10:46:44 +0000 | |
---|---|---|
committer | 2022-12-17 10:58:48 +0000 | |
commit | 4545c6a3d6ba71747eaa984c338ddd745e56e23f (patch) | |
tree | b763baaa590afe082b94857fcd9d81fc57a879c9 /arch/powerpc/platforms | |
parent | genirq/msi: Return MSI_XA_DOMAIN_SIZE as the maximum MSI index when no domain... (diff) | |
download | linux-4545c6a3d6ba71747eaa984c338ddd745e56e23f.tar.gz linux-4545c6a3d6ba71747eaa984c338ddd745e56e23f.tar.bz2 linux-4545c6a3d6ba71747eaa984c338ddd745e56e23f.zip |
powerpc/msi: Fix deassociation of MSI descriptors
Since 2f2940d16823 ("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 <linux@roeck-us.net>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/70dab88e-6119-0c12-7c6a-61bcbe239f66@roeck-us.net
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/4xx/hsta_msi.c | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/axon_msi.c | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/pasemi/msi.c | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/4xx/hsta_msi.c b/arch/powerpc/platforms/4xx/hsta_msi.c index d4f7fff1fc87..e11b57a62b05 100644 --- a/arch/powerpc/platforms/4xx/hsta_msi.c +++ b/arch/powerpc/platforms/4xx/hsta_msi.c @@ -115,6 +115,7 @@ static void hsta_teardown_msi_irqs(struct pci_dev *dev) msi_bitmap_free_hwirqs(&ppc4xx_hsta_msi.bmp, irq, 1); pr_debug("%s: Teardown IRQ %u (index %u)\n", __func__, entry->irq, irq); + entry->irq = 0; } } diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c index 5b012abca773..0c11aad896c7 100644 --- a/arch/powerpc/platforms/cell/axon_msi.c +++ b/arch/powerpc/platforms/cell/axon_msi.c @@ -289,6 +289,7 @@ static void axon_msi_teardown_msi_irqs(struct pci_dev *dev) msi_for_each_desc(entry, &dev->dev, MSI_DESC_ASSOCIATED) { irq_set_msi_desc(entry->irq, NULL); irq_dispose_mapping(entry->irq); + entry->irq = 0; } } diff --git a/arch/powerpc/platforms/pasemi/msi.c b/arch/powerpc/platforms/pasemi/msi.c index dc1846660005..166c97fff16d 100644 --- a/arch/powerpc/platforms/pasemi/msi.c +++ b/arch/powerpc/platforms/pasemi/msi.c @@ -66,6 +66,7 @@ static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev) hwirq = virq_to_hw(entry->irq); irq_set_msi_desc(entry->irq, NULL); irq_dispose_mapping(entry->irq); + entry->irq = 0; msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, ALLOC_CHUNK); } } |