Skip to content

Commit ebca439

Browse files
committed
genirq/msi: Provide data structs for per device domains
Provide struct msi_domain_template which contains a bundle of struct irq_chip, struct msi_domain_ops and struct msi_domain_info and a name field. This template is used by MSI device domain implementations to provide the domain specific functionality, feature bits etc. When a MSI domain is created the template is duplicated in the core code so that it can be modified per instance. That means templates can be marked const at the MSI device domain code. The template is a bundle to avoid several allocations and duplications of the involved structures. The name field is used to construct the final domain and chip name via: $PREFIX$NAME-$DEVNAME where prefix is the optional prefix of the MSI parent domain, $NAME is the provided name in template::chip and the device name so that the domain is properly identified. On x86 this results for PCI/MSI in: PCI-MSI-0000:3d:00.1 or IR-PCI-MSIX-0000:3d:00.1 depending on the domain type and the availability of remapping. 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/20221124232325.442499757@linutronix.de
1 parent b78780d commit ebca439

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

include/linux/msi.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <linux/xarray.h>
2525
#include <linux/mutex.h>
2626
#include <linux/list.h>
27+
#include <linux/irq.h>
2728
#include <linux/bits.h>
2829

2930
#include <asm/msi.h>
@@ -74,7 +75,6 @@ struct msi_msg {
7475

7576
extern int pci_msi_ignore_mask;
7677
/* Helper functions */
77-
struct irq_data;
7878
struct msi_desc;
7979
struct pci_dev;
8080
struct platform_msi_priv_data;
@@ -442,6 +442,20 @@ struct msi_domain_info {
442442
void *data;
443443
};
444444

445+
/**
446+
* struct msi_domain_template - Template for MSI device domains
447+
* @name: Storage for the resulting name. Filled in by the core.
448+
* @chip: Interrupt chip for this domain
449+
* @ops: MSI domain ops
450+
* @info: MSI domain info data
451+
*/
452+
struct msi_domain_template {
453+
char name[48];
454+
struct irq_chip chip;
455+
struct msi_domain_ops ops;
456+
struct msi_domain_info info;
457+
};
458+
445459
/*
446460
* Flags for msi_domain_info
447461
*

0 commit comments

Comments
 (0)