[tip: irq/msi] irqchip/msi-lib: Refuse initialization when irq_write_msi_msg() is missing

tip-bot2 for Thomas Gleixner posted 1 patch 1 month ago
drivers/irqchip/irq-msi-lib.c | 3 +++
1 file changed, 3 insertions(+)
[tip: irq/msi] irqchip/msi-lib: Refuse initialization when irq_write_msi_msg() is missing
Posted by tip-bot2 for Thomas Gleixner 1 month ago
The following commit has been merged into the irq/msi branch of tip:

Commit-ID:     aa80869b77e16d30ce69523528c63a2e2b050634
Gitweb:        https://git.kernel.org/tip/aa80869b77e16d30ce69523528c63a2e2b050634
Author:        Thomas Gleixner <tglx@kernel.org>
AuthorDate:    Tue, 03 Feb 2026 22:05:44 +01:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Tue, 24 Feb 2026 08:17:14 +01:00

irqchip/msi-lib: Refuse initialization when irq_write_msi_msg() is missing

MSI parent domains rely on the fact that the top level device domain
provides a irq_write_msi_msg() callback.

Check for that and if missing warn and refuse to initialize the device domain.

Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/87a4xp35cn.ffs@tglx
---
 drivers/irqchip/irq-msi-lib.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/irqchip/irq-msi-lib.c b/drivers/irqchip/irq-msi-lib.c
index d5eefc3..45e0ed3 100644
--- a/drivers/irqchip/irq-msi-lib.c
+++ b/drivers/irqchip/irq-msi-lib.c
@@ -48,6 +48,9 @@ bool msi_lib_init_dev_msi_info(struct device *dev, struct irq_domain *domain,
 		return false;
 	}
 
+	if (WARN_ON_ONCE(!chip->irq_write_msi_msg))
+		return false;
+
 	required_flags = pops->required_flags;
 
 	/* Is the target domain bus token supported? */