diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2021-12-07 01:51:05 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2021-12-17 00:22:17 +0300 |
commit | b5f687f97d1e112493fe0447a1fb09fbd93c334b (patch) | |
tree | 9893ade2ba9d2f36831f8f9b1f58483c6bf2e388 /include/linux/msi.h | |
parent | 125282cd4f33ecd53a24ae4807409da0e5e90fd4 (diff) | |
download | linux-b5f687f97d1e112493fe0447a1fb09fbd93c334b.tar.xz |
genirq/msi: Add mutex for MSI list protection
For upcoming runtime extensions of MSI-X interrupts it's required to
protect the MSI descriptor list. Add a mutex to struct msi_device_data and
provide lock/unlock functions.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Michael Kelley <mikelley@microsoft.com>
Tested-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20211206210747.708877269@linutronix.de
Diffstat (limited to 'include/linux/msi.h')
-rw-r--r-- | include/linux/msi.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/msi.h b/include/linux/msi.h index 4223e47103ed..2cf6c530588d 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -3,6 +3,7 @@ #define LINUX_MSI_H #include <linux/cpumask.h> +#include <linux/mutex.h> #include <linux/list.h> #include <asm/msi.h> @@ -145,17 +146,21 @@ struct msi_desc { * @attrs: Pointer to the sysfs attribute group * @platform_data: Platform-MSI specific data * @list: List of MSI descriptors associated to the device + * @mutex: Mutex protecting the MSI list */ struct msi_device_data { unsigned long properties; const struct attribute_group **attrs; struct platform_msi_priv_data *platform_data; struct list_head list; + struct mutex mutex; }; int msi_setup_device_data(struct device *dev); unsigned int msi_get_virq(struct device *dev, unsigned int index); +void msi_lock_descs(struct device *dev); +void msi_unlock_descs(struct device *dev); /* Helpers to hide struct msi_desc implementation details */ #define msi_desc_to_dev(desc) ((desc)->dev) |