summaryrefslogtreecommitdiff
path: root/drivers/pci/msi
diff options
context:
space:
mode:
authorAhmed S. Darwish <darwi@linutronix.de>2022-11-11 14:54:37 +0100
committerThomas Gleixner <tglx@linutronix.de>2022-11-17 15:15:19 +0100
commitb2bdda205c0c256d6483231d0afe58a6d68fd3ed (patch)
tree51b696d84e37a9f0a8d8b865662a2590c9229c13 /drivers/pci/msi
parent38c0c10ae6a3d386c50e182227f606d8243124b8 (diff)
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 <darwi@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://lore.kernel.org/r/20221111122014.409654736@linutronix.de
Diffstat (limited to 'drivers/pci/msi')
-rw-r--r--drivers/pci/msi/irqdomain.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/pci/msi/irqdomain.c b/drivers/pci/msi/irqdomain.c
index 7766fa6c475c..edd0cc204e06 100644
--- a/drivers/pci/msi/irqdomain.c
+++ b/drivers/pci/msi/irqdomain.c
@@ -24,11 +24,12 @@ void pci_msi_teardown_msi_irqs(struct pci_dev *dev)
struct irq_domain *domain;
domain = dev_get_msi_domain(&dev->dev);
- if (domain && irq_domain_is_hierarchy(domain))
+ if (domain && irq_domain_is_hierarchy(domain)) {
msi_domain_free_irqs_descs_locked(domain, &dev->dev);
- else
+ } else {
pci_msi_legacy_teardown_msi_irqs(dev);
- msi_free_msi_descs(&dev->dev);
+ msi_free_msi_descs(&dev->dev);
+ }
}
/**
@@ -170,6 +171,9 @@ struct irq_domain *pci_msi_create_irq_domain(struct fwnode_handle *fwnode,
if (info->flags & MSI_FLAG_USE_DEF_CHIP_OPS)
pci_msi_domain_update_chip_ops(info);
+ /* Let the core code free MSI descriptors when freeing interrupts */
+ info->flags |= MSI_FLAG_FREE_MSI_DESCS;
+
info->flags |= MSI_FLAG_ACTIVATE_EARLY | MSI_FLAG_DEV_SYSFS;
if (IS_ENABLED(CONFIG_GENERIC_IRQ_RESERVATION_MODE))
info->flags |= MSI_FLAG_MUST_REACTIVATE;