Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irqchip/irq-msi-lib: Prepare for DEVICE MSI to replace platform MSI

Add the prerequisites for DEVICE MSI into the shared select() and child
domain init function. These domains are really trivial and just provide a
custom irq chip callback to write the MSI message.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: Shivamurthy Shastri <shivamurthy.shastri@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20240623142235.085171290@linutronix.de



+17
+15
drivers/irqchip/irq-msi-lib.c
··· 57 57 return false; 58 58 59 59 break; 60 + case DOMAIN_BUS_DEVICE_MSI: 61 + /* 62 + * Per device MSI should never have any MSI feature bits 63 + * set. It's sole purpose is to create a dumb interrupt 64 + * chip which has a device specific irq_write_msi_msg() 65 + * callback. 66 + */ 67 + if (WARN_ON_ONCE(info->flags)) 68 + return false; 69 + 70 + /* Core managed MSI descriptors */ 71 + info->flags = MSI_FLAG_ALLOC_SIMPLE_MSI_DESCS | MSI_FLAG_FREE_MSI_DESCS; 72 + /* Remove PCI specific flags */ 73 + required_flags &= ~MSI_FLAG_PCI_MSI_MASK_PARENT; 74 + break; 60 75 default: 61 76 /* 62 77 * This should never be reached. See
+2
drivers/irqchip/irq-msi-lib.h
··· 15 15 #define MATCH_PCI_MSI (0) 16 16 #endif 17 17 18 + #define MATCH_PLATFORM_MSI BIT(DOMAIN_BUS_PLATFORM_MSI) 19 + 18 20 int msi_lib_irq_domain_select(struct irq_domain *d, struct irq_fwspec *fwspec, 19 21 enum irq_domain_bus_token bus_token); 20 22