Skip to content

Commit

Permalink
PCI/MSI: Provide stubs for IMS functions
Browse files Browse the repository at this point in the history
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 <reinette.chatre@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/14ff656899a3757453f8584c1109d7a9b98fa258.1697564731.git.reinette.chatre@intel.com
  • Loading branch information
rchatre authored and KAGA-KOKO committed Oct 17, 2023
1 parent f881feb commit 41efa43
Showing 1 changed file with 26 additions and 8 deletions.
34 changes: 26 additions & 8 deletions include/linux/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -1624,6 +1624,8 @@ struct msix_entry {
u16 entry; /* Driver uses to specify entry, OS writes */
};

struct msi_domain_template;

#ifdef CONFIG_PCI_MSI
int pci_msi_vec_count(struct pci_dev *dev);
void pci_disable_msi(struct pci_dev *dev);
Expand Down Expand Up @@ -1656,6 +1658,11 @@ void pci_msix_free_irq(struct pci_dev *pdev, struct msi_map map);
void pci_free_irq_vectors(struct pci_dev *dev);
int pci_irq_vector(struct pci_dev *dev, unsigned int nr);
const struct cpumask *pci_irq_get_affinity(struct pci_dev *pdev, int vec);
bool pci_create_ims_domain(struct pci_dev *pdev, const struct msi_domain_template *template,
unsigned int hwsize, void *data);
struct msi_map pci_ims_alloc_irq(struct pci_dev *pdev, union msi_instance_cookie *icookie,
const struct irq_affinity_desc *affdesc);
void pci_ims_free_irq(struct pci_dev *pdev, struct msi_map map);

#else
static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; }
Expand Down Expand Up @@ -1719,6 +1726,25 @@ static inline const struct cpumask *pci_irq_get_affinity(struct pci_dev *pdev,
{
return cpu_possible_mask;
}

static inline bool pci_create_ims_domain(struct pci_dev *pdev,
const struct msi_domain_template *template,
unsigned int hwsize, void *data)
{ return false; }

static inline struct msi_map pci_ims_alloc_irq(struct pci_dev *pdev,
union msi_instance_cookie *icookie,
const struct irq_affinity_desc *affdesc)
{
struct msi_map map = { .index = -ENOSYS, };

return map;
}

static inline void pci_ims_free_irq(struct pci_dev *pdev, struct msi_map map)
{
}

#endif

/**
Expand Down Expand Up @@ -2616,14 +2642,6 @@ static inline bool pci_is_thunderbolt_attached(struct pci_dev *pdev)
void pci_uevent_ers(struct pci_dev *pdev, enum pci_ers_result err_type);
#endif

struct msi_domain_template;

bool pci_create_ims_domain(struct pci_dev *pdev, const struct msi_domain_template *template,
unsigned int hwsize, void *data);
struct msi_map pci_ims_alloc_irq(struct pci_dev *pdev, union msi_instance_cookie *icookie,
const struct irq_affinity_desc *affdesc);
void pci_ims_free_irq(struct pci_dev *pdev, struct msi_map map);

#include <linux/dma-mapping.h>

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

0 comments on commit 41efa43

Please sign in to comment.