linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND v2 0/2] Enable TI SCI INTA MSI as loadable module
@ 2025-09-02 14:43 Guillaume La Roque
  2025-09-02 14:43 ` [PATCH RESEND v2 1/2] genirq/msi: Export functions to support TI SCI INTA MSI module Guillaume La Roque
  2025-09-02 14:43 ` [PATCH RESEND v2 2/2] soc: ti: ti_sci_inta_msi: Enable module compilation support Guillaume La Roque
  0 siblings, 2 replies; 4+ messages in thread
From: Guillaume La Roque @ 2025-09-02 14:43 UTC (permalink / raw)
  To: Thomas Gleixner, vigneshr, Nishanth Menon, Santosh Shilimkar,
	Tero Kristo
  Cc: linux-kernel, linux-arm-kernel, Guillaume La Roque

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

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
---
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/20250707-timsi-v1-0-80ae43b2c550@baylibre.com

---
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,
-- 
Guillaume La Roque <glaroque@baylibre.com>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH RESEND v2 1/2] genirq/msi: Export functions to support TI SCI INTA MSI module
  2025-09-02 14:43 [PATCH RESEND v2 0/2] Enable TI SCI INTA MSI as loadable module Guillaume La Roque
@ 2025-09-02 14:43 ` Guillaume La Roque
  2025-09-02 14:43 ` [PATCH RESEND v2 2/2] soc: ti: ti_sci_inta_msi: Enable module compilation support Guillaume La Roque
  1 sibling, 0 replies; 4+ messages in thread
From: Guillaume La Roque @ 2025-09-02 14:43 UTC (permalink / raw)
  To: Thomas Gleixner, vigneshr, Nishanth Menon, Santosh Shilimkar,
	Tero Kristo
  Cc: linux-kernel, linux-arm-kernel, 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:

- 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()

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
---
 kernel/irq/msi.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index 9febe797a5f6..4af232b6796b 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -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,

-- 
2.34.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH RESEND v2 2/2] soc: ti: ti_sci_inta_msi: Enable module compilation support
  2025-09-02 14:43 [PATCH RESEND v2 0/2] Enable TI SCI INTA MSI as loadable module Guillaume La Roque
  2025-09-02 14:43 ` [PATCH RESEND v2 1/2] genirq/msi: Export functions to support TI SCI INTA MSI module Guillaume La Roque
@ 2025-09-02 14:43 ` Guillaume La Roque
  2025-09-03  9:44   ` Thomas Gleixner
  1 sibling, 1 reply; 4+ messages in thread
From: Guillaume La Roque @ 2025-09-02 14:43 UTC (permalink / raw)
  To: Thomas Gleixner, vigneshr, Nishanth Menon, Santosh Shilimkar,
	Tero Kristo
  Cc: linux-kernel, linux-arm-kernel, 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.

Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
---
 drivers/soc/ti/Kconfig           | 5 ++++-
 drivers/soc/ti/ti_sci_inta_msi.c | 5 +++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/ti/Kconfig b/drivers/soc/ti/Kconfig
index 1a93001c9e36..0a9eb5ac264b 100644
--- a/drivers/soc/ti/Kconfig
+++ b/drivers/soc/ti/Kconfig
@@ -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.
diff --git a/drivers/soc/ti/ti_sci_inta_msi.c b/drivers/soc/ti/ti_sci_inta_msi.c
index 193266f5e3f9..d92cab319d57 100644
--- a/drivers/soc/ti/ti_sci_inta_msi.c
+++ b/drivers/soc/ti/ti_sci_inta_msi.c
@@ -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 <lokeshvutla@ti.com>");

-- 
2.34.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH RESEND v2 2/2] soc: ti: ti_sci_inta_msi: Enable module compilation support
  2025-09-02 14:43 ` [PATCH RESEND v2 2/2] soc: ti: ti_sci_inta_msi: Enable module compilation support Guillaume La Roque
@ 2025-09-03  9:44   ` Thomas Gleixner
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2025-09-03  9:44 UTC (permalink / raw)
  To: Guillaume La Roque, vigneshr, Nishanth Menon, Santosh Shilimkar,
	Tero Kristo
  Cc: linux-kernel, linux-arm-kernel, Guillaume La Roque

On Tue, Sep 02 2025 at 16:43, Guillaume La Roque wrote:
> 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






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-09-03 10:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-02 14:43 [PATCH RESEND v2 0/2] Enable TI SCI INTA MSI as loadable module Guillaume La Roque
2025-09-02 14:43 ` [PATCH RESEND v2 1/2] genirq/msi: Export functions to support TI SCI INTA MSI module Guillaume La Roque
2025-09-02 14:43 ` [PATCH RESEND v2 2/2] soc: ti: ti_sci_inta_msi: Enable module compilation support Guillaume La Roque
2025-09-03  9:44   ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).