Commit 2d958b02 authored by Thomas Gleixner's avatar Thomas Gleixner

genirq/msi: Rearrange MSI domain flags

These flags got added as necessary and have no obvious structure. For
feature support checks and masking it's convenient to have two blocks of
flags:

   1) Flags to control the internal behaviour like allocating/freeing
      MSI descriptors. Those flags do not need any support from the
      underlying MSI parent domain. They are mostly under the control
      of the outermost domain which implements the actual MSI support.

   2) Flags to expose features, e.g. PCI multi-MSI or requirements
      which can depend on a underlying domain.

No functional change.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
Acked-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20221124232325.322714918@linutronix.de
parent c459f11f
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include <linux/xarray.h> #include <linux/xarray.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/bits.h>
#include <asm/msi.h> #include <asm/msi.h>
/* Dummy shadow structures if an architecture does not define them */ /* Dummy shadow structures if an architecture does not define them */
...@@ -440,7 +442,16 @@ struct msi_domain_info { ...@@ -440,7 +442,16 @@ struct msi_domain_info {
void *data; void *data;
}; };
/* Flags for msi_domain_info */ /*
* Flags for msi_domain_info
*
* Bit 0-15: Generic MSI functionality which is not subject to restriction
* by parent domains
*
* Bit 16-31: Functionality which depends on the underlying parent domain and
* can be masked out by msi_parent_ops::init_dev_msi_info() when
* a device MSI domain is initialized.
*/
enum { enum {
/* /*
* Init non implemented ops callbacks with default MSI domain * Init non implemented ops callbacks with default MSI domain
...@@ -452,33 +463,41 @@ enum { ...@@ -452,33 +463,41 @@ enum {
* callbacks. * callbacks.
*/ */
MSI_FLAG_USE_DEF_CHIP_OPS = (1 << 1), MSI_FLAG_USE_DEF_CHIP_OPS = (1 << 1),
/* Support multiple PCI MSI interrupts */
MSI_FLAG_MULTI_PCI_MSI = (1 << 2),
/* Support PCI MSIX interrupts */
MSI_FLAG_PCI_MSIX = (1 << 3),
/* Needs early activate, required for PCI */ /* Needs early activate, required for PCI */
MSI_FLAG_ACTIVATE_EARLY = (1 << 4), MSI_FLAG_ACTIVATE_EARLY = (1 << 2),
/* /*
* Must reactivate when irq is started even when * Must reactivate when irq is started even when
* MSI_FLAG_ACTIVATE_EARLY has been set. * MSI_FLAG_ACTIVATE_EARLY has been set.
*/ */
MSI_FLAG_MUST_REACTIVATE = (1 << 5), MSI_FLAG_MUST_REACTIVATE = (1 << 3),
/* Is level-triggered capable, using two messages */
MSI_FLAG_LEVEL_CAPABLE = (1 << 6),
/* Populate sysfs on alloc() and destroy it on free() */ /* Populate sysfs on alloc() and destroy it on free() */
MSI_FLAG_DEV_SYSFS = (1 << 7), MSI_FLAG_DEV_SYSFS = (1 << 4),
/* MSI-X entries must be contiguous */
MSI_FLAG_MSIX_CONTIGUOUS = (1 << 8),
/* Allocate simple MSI descriptors */ /* Allocate simple MSI descriptors */
MSI_FLAG_ALLOC_SIMPLE_MSI_DESCS = (1 << 9), MSI_FLAG_ALLOC_SIMPLE_MSI_DESCS = (1 << 5),
/* Free MSI descriptors */ /* Free MSI descriptors */
MSI_FLAG_FREE_MSI_DESCS = (1 << 10), MSI_FLAG_FREE_MSI_DESCS = (1 << 6),
/* /*
* Quirk to handle MSI implementations which do not provide * Quirk to handle MSI implementations which do not provide
* masking. Currently known to affect x86, but has to be partially * masking. Currently known to affect x86, but has to be partially
* handled in the core MSI code. * handled in the core MSI code.
*/ */
MSI_FLAG_NOMASK_QUIRK = (1 << 11), MSI_FLAG_NOMASK_QUIRK = (1 << 7),
/* Mask for the generic functionality */
MSI_GENERIC_FLAGS_MASK = GENMASK(15, 0),
/* Mask for the domain specific functionality */
MSI_DOMAIN_FLAGS_MASK = GENMASK(31, 16),
/* Support multiple PCI MSI interrupts */
MSI_FLAG_MULTI_PCI_MSI = (1 << 16),
/* Support PCI MSIX interrupts */
MSI_FLAG_PCI_MSIX = (1 << 17),
/* Is level-triggered capable, using two messages */
MSI_FLAG_LEVEL_CAPABLE = (1 << 18),
/* MSI-X entries must be contiguous */
MSI_FLAG_MSIX_CONTIGUOUS = (1 << 19),
}; };
int msi_domain_set_affinity(struct irq_data *data, const struct cpumask *mask, int msi_domain_set_affinity(struct irq_data *data, const struct cpumask *mask,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment