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

Thomas Gleixner posted 1 patch 3 days, 18 hours ago
drivers/irqchip/irq-msi-lib.c |    3 +++
1 file changed, 3 insertions(+)
[PATCH] irqchip/msi-lib: Refuse initialization when irq_write_msi_msg() is missing
Posted by Thomas Gleixner 3 days, 18 hours ago
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>
---
 drivers/irqchip/irq-msi-lib.c |    3 +++
 1 file changed, 3 insertions(+)

--- 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 de
 		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? */