Skip to contentSkip to conversation

Enable TI SCI INTA MSI as loadable module

PATCH RESEND In review Guillaume La Roque 3 participants 6 messages Sep 2, 2025 – Sep 4, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover Enable TI SCI INTA MSI as loadable module

This series enables the TI SCI INTA MSI driver to be compiled as a loadable module instead of being built-in only. This provides more flexibility for system configuration and reduces kernel size when the functionality is not always needed.

The series includes two patches:
- Export necessary MSI functions from the core kernel to support module compilation
- Update the TI SCI INTA MSI driver to support module compilation

---
Changes in v2:
- Fixed patch subject
- Replaced 'symbols' with more precise 'functions' terminology
- Used function notation with parentheses for exported functions
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Guillaume La Roque (2):
genirq/msi: Export functions to support TI SCI INTA MSI module
soc: ti: ti_sci_inta_msi: Enable module compilation support

 drivers/soc/ti/Kconfig           | 5 ++++-
 drivers/soc/ti/ti_sci_inta_msi.c | 5 +++++
 kernel/irq/msi.c                 | 5 +++++
 3 files changed, 14 insertions(+), 1 deletion(-)

---
base-commit: 666f6d7e7fadd8132f310a87d1f8ae08c3966e4a
change-id: 20250707-timsi-c66a2816c84f

Best regards,

Signature · 1 line
Guillaume La Roque <[email protected]>
#1 lore raw

PATCH RESEND v2 1/2 genirq/msi: Export functions to support TI SCI INTA MSI module

Export MSI domain management functions to allow the TI SCI INTA MSI driver to be compiled as a module.

The following functions are now available for module use:

- msi_domain_insert_msi_desc()
- msi_domain_free_msi_descs_range()
- msi_setup_device_data()
- msi_create_irq_domain()
- msi_domain_alloc_irqs_all_locked()

---
 kernel/irq/msi.c | 5 +++++
 1 file changed, 5 insertions(+)
kernel/irq/msi.c +5 -0
index 9febe797a5f6..4af232b6796b 100644
@@ -163,6 +163,7 @@ int msi_domain_insert_msi_desc(struct device *dev, unsigned int domid,
 
 	return msi_insert_desc(dev, desc, domid, init_desc->msi_index);
 }
+EXPORT_SYMBOL_GPL(msi_domain_insert_msi_desc);
 
 static bool msi_desc_match(struct msi_desc *desc, enum msi_desc_filter filter)
 {
@@ -235,6 +236,7 @@ void msi_domain_free_msi_descs_range(struct device *dev, unsigned int domid,
 
 	msi_domain_free_descs(dev, &ctrl);
 }
+EXPORT_SYMBOL_GPL(msi_domain_free_msi_descs_range);
 
 /**
  * msi_domain_add_simple_msi_descs - Allocate and initialize MSI descriptors
@@ -342,6 +344,7 @@ int msi_setup_device_data(struct device *dev)
 	devres_add(dev, md);
 	return 0;
 }
+EXPORT_SYMBOL_GPL(msi_setup_device_data);
 
 /**
  * __msi_lock_descs - Lock the MSI descriptor storage of a device
@@ -910,6 +913,7 @@ struct irq_domain *msi_create_irq_domain(struct fwnode_handle *fwnode,
 {
 	return __msi_create_irq_domain(fwnode, info, 0, parent);
 }
+EXPORT_SYMBOL_GPL(msi_create_irq_domain);
 
 /**
  * msi_create_parent_irq_domain - Create an MSI-parent interrupt domain
@@ -1472,6 +1476,7 @@ int msi_domain_alloc_irqs_all_locked(struct device *dev, unsigned int domid, int
 
 	return msi_domain_alloc_locked(dev, &ctrl);
 }
+EXPORT_SYMBOL_GPL(msi_domain_alloc_irqs_all_locked);
 
 static struct msi_map __msi_domain_alloc_irq_at(struct device *dev, unsigned int domid,
 						unsigned int index,
Signature · 1 line
2.34.1
Reviewed-by on v2 1/2
#2 lore raw

Re: [PATCH RESEND v2 1/2] genirq/msi: Export functions to support TI SCI INTA MSI module

Quoted 5 lines · Guillaume La Roque

Export MSI domain management functions to allow the TI SCI INTA MSI driver to be compiled as a module.

The following functions are now available for module use:

Quoted 8 lines

- msi_domain_insert_msi_desc()
- msi_domain_free_msi_descs_range()
- msi_setup_device_data()
- msi_create_irq_domain()
- msi_domain_alloc_irqs_all_locked()

---

Signature · 3 lines
Best regards,
Dhruva Gole
Texas Instruments Incorporated
#3 lore raw

PATCH RESEND v2 2/2 soc: ti: ti_sci_inta_msi: Enable module compilation support

In reply to Guillaume La Roque

Add module support to the TI SCI INTA MSI driver:
- Change Kconfig from bool to tristate to allow module compilation
- Add linux/module.h include for module functionality
- Add MODULE_LICENSE, MODULE_DESCRIPTION, and MODULE_AUTHOR macros

This allows the driver to be compiled as a loadable kernel module named ti_sci_inta_msi.

---
 drivers/soc/ti/Kconfig           | 5 ++++-
 drivers/soc/ti/ti_sci_inta_msi.c | 5 +++++
 2 files changed, 9 insertions(+), 1 deletion(-)
drivers/soc/ti/Kconfig +4 -1
index 1a93001c9e36..0a9eb5ac264b 100644
@@ -85,7 +85,10 @@ config TI_PRUSS
 endif # SOC_TI
 
 config TI_SCI_INTA_MSI_DOMAIN
-	bool
+	tristate "TI SCI INTA MSI Domain driver"
 	select GENERIC_MSI_IRQ
 	help
 	  Driver to enable Interrupt Aggregator specific MSI Domain.
+
+	  Say Y here to compile it into the kernel or M to compile it as a
+	  module. The module will be called ti_sci_inta_msi.
drivers/soc/ti/ti_sci_inta_msi.c +5 -0
index 193266f5e3f9..d92cab319d57 100644
@@ -8,6 +8,7 @@
 
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
+#include <linux/module.h>
 #include <linux/msi.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
@@ -115,3 +116,7 @@ int ti_sci_inta_msi_domain_alloc_irqs(struct device *dev,
 	return ret;
 }
 EXPORT_SYMBOL_GPL(ti_sci_inta_msi_domain_alloc_irqs);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Texas Instruments K3 Interrupt Aggregator MSI bus");
+MODULE_AUTHOR("Lokesh Vutla <[email protected]>");
Signature · 1 line
2.34.1
#4 lore raw

Re: [PATCH RESEND v2 2/2] soc: ti: ti_sci_inta_msi: Enable module compilation support

Quoted 7 lines · Guillaume La Roque

Add module support to the TI SCI INTA MSI driver:
- Change Kconfig from bool to tristate to allow module compilation
- Add linux/module.h include for module functionality
- Add MODULE_LICENSE, MODULE_DESCRIPTION, and MODULE_AUTHOR macros

This allows the driver to be compiled as a loadable kernel module named ti_sci_inta_msi.

No objection per se, but looking at this "driver" just makes me cry. There is zero justification for this to be separate from the actual ti-sci-inta irq chip driver, which selects this monstrosity unconditionally.

All of this code can be moved into the irq chip driver and thereby consolidated to do the chip initialization and the domain fiddling in the related data structures instead of doing it programatically. Consolidating it reduces the number of exports and makes it one module.

No?

Thanks,

tglx

Reviewed-by on v2 2/2
#5 lore raw

Re: [PATCH RESEND v2 2/2] soc: ti: ti_sci_inta_msi: Enable module compilation support

In reply to Guillaume La Roque
Quoted 5 lines · Guillaume La Roque

Add module support to the TI SCI INTA MSI driver:
- Change Kconfig from bool to tristate to allow module compilation
- Add linux/module.h include for module functionality
- Add MODULE_LICENSE, MODULE_DESCRIPTION, and MODULE_AUTHOR macros

Quoted 9 lines

This allows the driver to be compiled as a loadable kernel module named ti_sci_inta_msi.

---
 drivers/soc/ti/Kconfig           | 5 ++++-
 drivers/soc/ti/ti_sci_inta_msi.c | 5 +++++
 2 files changed, 9 insertions(+), 1 deletion(-)
Signature · 3 lines
Best regards,
Dhruva Gole
Texas Instruments Incorporated