]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
irqchip/irq-msi-lib: Prepare for DEVICE MSI to replace platform MSI
authorThomas Gleixner <tglx@linutronix.de>
Sun, 23 Jun 2024 15:18:41 +0000 (17:18 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 18 Jul 2024 18:31:20 +0000 (20:31 +0200)
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
drivers/irqchip/irq-msi-lib.c
drivers/irqchip/irq-msi-lib.h

index ef26962a31ee699547a306551f8f2a0beea67b16..b98a2191c8600816e9b870fd185b76709b22422a 100644 (file)
@@ -56,6 +56,21 @@ bool msi_lib_init_dev_msi_info(struct device *dev, struct irq_domain *domain,
                if (WARN_ON_ONCE(!IS_ENABLED(CONFIG_PCI_MSI)))
                        return false;
 
+               break;
+       case DOMAIN_BUS_DEVICE_MSI:
+               /*
+                * Per device MSI should never have any MSI feature bits
+                * set. It's sole purpose is to create a dumb interrupt
+                * chip which has a device specific irq_write_msi_msg()
+                * callback.
+                */
+               if (WARN_ON_ONCE(info->flags))
+                       return false;
+
+               /* Core managed MSI descriptors */
+               info->flags = MSI_FLAG_ALLOC_SIMPLE_MSI_DESCS | MSI_FLAG_FREE_MSI_DESCS;
+               /* Remove PCI specific flags */
+               required_flags &= ~MSI_FLAG_PCI_MSI_MASK_PARENT;
                break;
        default:
                /*
index 525aa5284a9910329690f5af3f3cb5e2f326055a..681ceabb7bc74080dec7e8d0dee6fa0bd80b1ca7 100644 (file)
@@ -15,6 +15,8 @@
 #define MATCH_PCI_MSI          (0)
 #endif
 
+#define MATCH_PLATFORM_MSI     BIT(DOMAIN_BUS_PLATFORM_MSI)
+
 int msi_lib_irq_domain_select(struct irq_domain *d, struct irq_fwspec *fwspec,
                              enum irq_domain_bus_token bus_token);