summaryrefslogtreecommitdiffstats
path: root/include/linux/msi_api.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2022-11-25 00:26:15 +0100
committerThomas Gleixner <tglx@linutronix.de>2022-12-05 22:22:33 +0100
commitefd42049657e958797a483f793e4064042faa49c (patch)
treee0518a0513f1124d8356db49d6a2d054c2c84687 /include/linux/msi_api.h
parent06bff9e347271566e8dd79e7c3eb971660209a00 (diff)
downloadlinux-efd42049657e958797a483f793e4064042faa49c.tar.gz
linux-efd42049657e958797a483f793e4064042faa49c.tar.bz2
linux-efd42049657e958797a483f793e4064042faa49c.zip
genirq/msi: Provide msi_desc:: Msi_data
The upcoming support for PCI/IMS requires to store some information related to the message handling in the MSI descriptor, e.g. PASID or a pointer to a queue. Provide a generic storage struct which maps over the existing PCI specific storage which means the size of struct msi_desc is not getting bigger. This storage struct has two elements: 1) msi_domain_cookie 2) msi_instance_cookie The domain cookie is going to be used to store domain specific information, e.g. iobase pointer, data pointer. The instance cookie is going to be handed in when allocating an interrupt on an IMS domain so the irq chip callbacks of the IMS domain have the necessary per vector information available. It also comes in handy when cleaning up the platform MSI code for wire to MSI bridges which need to hand down the type information to the underlying interrupt domain. For the core code the cookies are opaque and meaningless. It just stores the instance cookie during an allocation through the upcoming interfaces for IMS and wire to MSI brigdes. 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/20221124232326.385036043@linutronix.de
Diffstat (limited to 'include/linux/msi_api.h')
-rw-r--r--include/linux/msi_api.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/msi_api.h b/include/linux/msi_api.h
index 4cb7f4c9a3ae..2e4456ec9f6b 100644
--- a/include/linux/msi_api.h
+++ b/include/linux/msi_api.h
@@ -19,6 +19,23 @@ enum msi_domain_ids {
};
/**
+ * union msi_instance_cookie - MSI instance cookie
+ * @value: u64 value store
+ * @ptr: Pointer to usage site specific data
+ *
+ * This cookie is handed to the IMS allocation function and stored in the
+ * MSI descriptor for the interrupt chip callbacks.
+ *
+ * The content of this cookie is MSI domain implementation defined. For
+ * PCI/IMS implementations this could be a PASID or a pointer to queue
+ * memory.
+ */
+union msi_instance_cookie {
+ u64 value;
+ void *ptr;
+};
+
+/**
* msi_map - Mapping between MSI index and Linux interrupt number
* @index: The MSI index, e.g. slot in the MSI-X table or
* a software managed index if >= 0. If negative