aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/msi.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2024-01-27 21:47:33 +0530
committerThomas Gleixner <tglx@linutronix.de>2024-02-15 17:55:40 +0100
commitc88f9110bfbca5975a8dee4c9792ba12684c7bca (patch)
treeb02b7bc3d2009ebe80fed5d1384b4b90eeebb2df /include/linux/msi.h
parentgenirq/irqdomain: Add DOMAIN_BUS_DEVICE_MSI (diff)
downloadwireguard-linux-c88f9110bfbca5975a8dee4c9792ba12684c7bca.tar.xz
wireguard-linux-c88f9110bfbca5975a8dee4c9792ba12684c7bca.zip
platform-msi: Prepare for real per device domains
Provide functions to create and remove per device MSI domains which replace the platform-MSI domains. The new model is that each of the devices which utilize platform-MSI gets now its private MSI domain which is "customized" in size and with a device specific function to write the MSI message into the device. This is the same functionality as platform-MSI but it avoids all the down sides of platform MSI, i.e. the extra ID book keeping, the special data structure in the msi descriptor. Further the domains are only created when the devices are really in use, so the burden is on the usage and not on the infrastructure. Fill in the domain template and provide two functions to init/allocate and remove a per device MSI domain. Until all users and parent domain providers are converted, the init/alloc function invokes the original platform-MSI code when the irqdomain which is associated to the device does not provide MSI parent functionality yet. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Anup Patel <apatel@ventanamicro.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20240127161753.114685-6-apatel@ventanamicro.com
Diffstat (limited to 'include/linux/msi.h')
-rw-r--r--include/linux/msi.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/msi.h b/include/linux/msi.h
index d5d1513ef4d6..ef167961c782 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -664,6 +664,10 @@ int platform_msi_device_domain_alloc(struct irq_domain *domain, unsigned int vir
void platform_msi_device_domain_free(struct irq_domain *domain, unsigned int virq,
unsigned int nvec);
void *platform_msi_get_host_data(struct irq_domain *domain);
+/* Per device platform MSI */
+int platform_device_msi_init_and_alloc_irqs(struct device *dev, unsigned int nvec,
+ irq_write_msi_msg_t write_msi_msg);
+void platform_device_msi_free_irqs_all(struct device *dev);
bool msi_device_has_isolated_msi(struct device *dev);
#else /* CONFIG_GENERIC_MSI_IRQ */