diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2022-11-25 00:24:20 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2022-12-05 19:20:59 +0100 |
commit | f1139f905bd2d8bec59be0c1404b592279ae0ac9 (patch) | |
tree | 6e83552b1e2d3e478027587f84050d6c06089598 /include | |
parent | 3e86a3a3ed031dd498e614db0fa082a58d700df9 (diff) |
genirq/msi: Move xarray into a separate struct and create an array
The upcoming support for multiple MSI domains per device requires storage
for the MSI descriptors and in a second step storage for the irqdomain
pointers.
Move the xarray into a separate data structure msi_dev_domain and create an
array with size 1 in msi_device_data, which can be expanded later when the
support for per device domains is implemented.
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/20221124230313.864887773@linutronix.de
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/msi.h | 13 | ||||
-rw-r--r-- | include/linux/msi_api.h | 8 |
2 files changed, 19 insertions, 2 deletions
diff --git a/include/linux/msi.h b/include/linux/msi.h index 9f72494dcc3e..f7b9c41a4f54 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -173,19 +173,28 @@ enum msi_desc_filter { MSI_DESC_ASSOCIATED, }; + +/** + * struct msi_dev_domain - The internals of MSI domain info per device + * @store: Xarray for storing MSI descriptor pointers + */ +struct msi_dev_domain { + struct xarray store; +}; + /** * msi_device_data - MSI per device data * @properties: MSI properties which are interesting to drivers * @platform_data: Platform-MSI specific data * @mutex: Mutex protecting the MSI descriptor store - * @__store: Xarray for storing MSI descriptor pointers + * @__domains: Internal data for per device MSI domains * @__iter_idx: Index to search the next entry for iterators */ struct msi_device_data { unsigned long properties; struct platform_msi_priv_data *platform_data; struct mutex mutex; - struct xarray __store; + struct msi_dev_domain __domains[MSI_MAX_DEVICE_IRQDOMAINS]; unsigned long __iter_idx; }; diff --git a/include/linux/msi_api.h b/include/linux/msi_api.h index 57d27cfcde2d..4dbbce68a217 100644 --- a/include/linux/msi_api.h +++ b/include/linux/msi_api.h @@ -10,6 +10,14 @@ struct device; +/* + * Per device interrupt domain related constants. + */ +enum msi_domain_ids { + MSI_DEFAULT_DOMAIN, + MSI_MAX_DEVICE_IRQDOMAINS, +}; + unsigned int msi_get_virq(struct device *dev, unsigned int index); #endif |