Skip to content

Commit a9e894d

Browse files
author
Maxim Levitsky
committed
PCI/MSI: Export pci_msix_prepare_desc() for dynamic MSI-X allocations
JIRA: https://issues.redhat.com/browse/RHEL-109583 commit 5da8a8b Author: Shradha Gupta <shradhagupta@linux.microsoft.com> Date: Wed Jun 11 07:10:01 2025 -0700 PCI/MSI: Export pci_msix_prepare_desc() for dynamic MSI-X allocations For supporting dynamic MSI-X vector allocation by PCI controllers, enabling the flag MSI_FLAG_PCI_MSIX_ALLOC_DYN is not enough, msix_prepare_msi_desc() to prepare the MSI descriptor is also needed. Export pci_msix_prepare_desc() to allow PCI controllers to support dynamic MSI-X vector allocation. Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Saurabh Sengar <ssengar@linux.microsoft.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
1 parent aca14ca commit a9e894d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

drivers/pci/msi/irqdomain.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,14 @@ static void pci_irq_unmask_msix(struct irq_data *data)
202202
pci_msix_unmask(irq_data_get_msi_desc(data));
203203
}
204204

205-
static void pci_msix_prepare_desc(struct irq_domain *domain, msi_alloc_info_t *arg,
206-
struct msi_desc *desc)
205+
void pci_msix_prepare_desc(struct irq_domain *domain, msi_alloc_info_t *arg,
206+
struct msi_desc *desc)
207207
{
208208
/* Don't fiddle with preallocated MSI descriptors */
209209
if (!desc->pci.mask_base)
210210
msix_prepare_msi_desc(to_pci_dev(desc->dev), desc);
211211
}
212+
EXPORT_SYMBOL_GPL(pci_msix_prepare_desc);
212213

213214
static const struct msi_domain_template pci_msix_template = {
214215
.chip = {

include/linux/msi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,8 @@ struct irq_domain *pci_msi_create_irq_domain(struct fwnode_handle *fwnode,
674674
struct irq_domain *parent);
675675
u32 pci_msi_domain_get_msi_rid(struct irq_domain *domain, struct pci_dev *pdev);
676676
struct irq_domain *pci_msi_get_device_domain(struct pci_dev *pdev);
677+
void pci_msix_prepare_desc(struct irq_domain *domain, msi_alloc_info_t *arg,
678+
struct msi_desc *desc);
677679
#else /* CONFIG_PCI_MSI */
678680
static inline struct irq_domain *pci_msi_get_device_domain(struct pci_dev *pdev)
679681
{

0 commit comments

Comments
 (0)