diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2022-11-25 00:24:29 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2022-12-05 19:20:59 +0100 |
commit | fc8ab388325ddfd848d00f3a3383b4304594546a (patch) | |
tree | 0a21fa7bb25e214cf5cadd55dafe029e72bd1346 /include | |
parent | 1c89396300292da4e4a87db63bef45975461fa25 (diff) |
genirq/msi: Make descriptor allocation device domain aware
Change the descriptor allocation and insertion functions to take a domain
id to prepare for the upcoming multi MSI domain per device support.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20221124230314.163043028@linutronix.de
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/msi.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/linux/msi.h b/include/linux/msi.h index f8ba85af3542..35e9d0050ca1 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -286,7 +286,21 @@ static inline void msi_desc_set_iommu_cookie(struct msi_desc *desc, } #endif -int msi_insert_msi_desc(struct device *dev, struct msi_desc *init_desc); +int msi_domain_insert_msi_desc(struct device *dev, unsigned int domid, + struct msi_desc *init_desc); +/** + * msi_insert_msi_desc - Allocate and initialize a MSI descriptor in the + * default irqdomain and insert it at @init_desc->msi_index + * @dev: Pointer to the device for which the descriptor is allocated + * @init_desc: Pointer to an MSI descriptor to initialize the new descriptor + * + * Return: 0 on success or an appropriate failure code. + */ +static inline int msi_insert_msi_desc(struct device *dev, struct msi_desc *init_desc) +{ + return msi_domain_insert_msi_desc(dev, MSI_DEFAULT_DOMAIN, init_desc); +} + void msi_free_msi_descs_range(struct device *dev, unsigned int first_index, unsigned int last_index); /** |