Skip to content

Commit b2bdda2

Browse files
Ahmed S. DarwishKAGA-KOKO
authored andcommitted
PCI/MSI: Let the MSI core free descriptors
Let the core do the freeing of descriptors and just keep it around for the legacy case. Signed-off-by: Ahmed S. Darwish <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 38c0c10 commit b2bdda2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/pci/msi/irqdomain.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ void pci_msi_teardown_msi_irqs(struct pci_dev *dev)
2424
struct irq_domain *domain;
2525

2626
domain = dev_get_msi_domain(&dev->dev);
27-
if (domain && irq_domain_is_hierarchy(domain))
27+
if (domain && irq_domain_is_hierarchy(domain)) {
2828
msi_domain_free_irqs_descs_locked(domain, &dev->dev);
29-
else
29+
} else {
3030
pci_msi_legacy_teardown_msi_irqs(dev);
31-
msi_free_msi_descs(&dev->dev);
31+
msi_free_msi_descs(&dev->dev);
32+
}
3233
}
3334

3435
/**
@@ -170,6 +171,9 @@ struct irq_domain *pci_msi_create_irq_domain(struct fwnode_handle *fwnode,
170171
if (info->flags & MSI_FLAG_USE_DEF_CHIP_OPS)
171172
pci_msi_domain_update_chip_ops(info);
172173

174+
/* Let the core code free MSI descriptors when freeing interrupts */
175+
info->flags |= MSI_FLAG_FREE_MSI_DESCS;
176+
173177
info->flags |= MSI_FLAG_ACTIVATE_EARLY | MSI_FLAG_DEV_SYSFS;
174178
if (IS_ENABLED(CONFIG_GENERIC_IRQ_RESERVATION_MODE))
175179
info->flags |= MSI_FLAG_MUST_REACTIVATE;

0 commit comments

Comments
 (0)