Skip to content

Commit 41efa43

Browse files
rchatreKAGA-KOKO
authored andcommitted
PCI/MSI: Provide stubs for IMS functions
The IMS related functions (pci_create_ims_domain(), pci_ims_alloc_irq(), and pci_ims_free_irq()) are not declared when CONFIG_PCI_MSI is disabled. Provide definitions of these functions for use when callers are compiled with CONFIG_PCI_MSI disabled. Fixes: 0194425 ("PCI/MSI: Provide IMS (Interrupt Message Store) support") Fixes: c9e5bea ("PCI/MSI: Provide pci_ims_alloc/free_irq()") Signed-off-by: Reinette Chatre <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/14ff656899a3757453f8584c1109d7a9b98fa258.1697564731.git.reinette.chatre@intel.com
1 parent f881feb commit 41efa43

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

include/linux/pci.h

+26-8
Original file line numberDiff line numberDiff line change
@@ -1624,6 +1624,8 @@ struct msix_entry {
16241624
u16 entry; /* Driver uses to specify entry, OS writes */
16251625
};
16261626

1627+
struct msi_domain_template;
1628+
16271629
#ifdef CONFIG_PCI_MSI
16281630
int pci_msi_vec_count(struct pci_dev *dev);
16291631
void pci_disable_msi(struct pci_dev *dev);
@@ -1656,6 +1658,11 @@ void pci_msix_free_irq(struct pci_dev *pdev, struct msi_map map);
16561658
void pci_free_irq_vectors(struct pci_dev *dev);
16571659
int pci_irq_vector(struct pci_dev *dev, unsigned int nr);
16581660
const struct cpumask *pci_irq_get_affinity(struct pci_dev *pdev, int vec);
1661+
bool pci_create_ims_domain(struct pci_dev *pdev, const struct msi_domain_template *template,
1662+
unsigned int hwsize, void *data);
1663+
struct msi_map pci_ims_alloc_irq(struct pci_dev *pdev, union msi_instance_cookie *icookie,
1664+
const struct irq_affinity_desc *affdesc);
1665+
void pci_ims_free_irq(struct pci_dev *pdev, struct msi_map map);
16591666

16601667
#else
16611668
static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; }
@@ -1719,6 +1726,25 @@ static inline const struct cpumask *pci_irq_get_affinity(struct pci_dev *pdev,
17191726
{
17201727
return cpu_possible_mask;
17211728
}
1729+
1730+
static inline bool pci_create_ims_domain(struct pci_dev *pdev,
1731+
const struct msi_domain_template *template,
1732+
unsigned int hwsize, void *data)
1733+
{ return false; }
1734+
1735+
static inline struct msi_map pci_ims_alloc_irq(struct pci_dev *pdev,
1736+
union msi_instance_cookie *icookie,
1737+
const struct irq_affinity_desc *affdesc)
1738+
{
1739+
struct msi_map map = { .index = -ENOSYS, };
1740+
1741+
return map;
1742+
}
1743+
1744+
static inline void pci_ims_free_irq(struct pci_dev *pdev, struct msi_map map)
1745+
{
1746+
}
1747+
17221748
#endif
17231749

17241750
/**
@@ -2616,14 +2642,6 @@ static inline bool pci_is_thunderbolt_attached(struct pci_dev *pdev)
26162642
void pci_uevent_ers(struct pci_dev *pdev, enum pci_ers_result err_type);
26172643
#endif
26182644

2619-
struct msi_domain_template;
2620-
2621-
bool pci_create_ims_domain(struct pci_dev *pdev, const struct msi_domain_template *template,
2622-
unsigned int hwsize, void *data);
2623-
struct msi_map pci_ims_alloc_irq(struct pci_dev *pdev, union msi_instance_cookie *icookie,
2624-
const struct irq_affinity_desc *affdesc);
2625-
void pci_ims_free_irq(struct pci_dev *pdev, struct msi_map map);
2626-
26272645
#include <linux/dma-mapping.h>
26282646

26292647
#define pci_printk(level, pdev, fmt, arg...) \

0 commit comments

Comments
 (0)