Skip to contentSkip to conversation

irqchip: Kconfig: Add module support for TI inta/intr

PATCH Superseded Guillaume La Roque 3 participants 10 messages Oct 16, 2024 – Oct 18, 2024

Subsystems (3)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover irqchip: Kconfig: Add module support for TI inta/intr

Added module support for TI interrupt aggregator and interrupt router drivers. Default value for both drivers is ARCH_K3 and the interrupt aggregator depends on ARCH_K3 as it contains 64 bit only ops. Tested allmodconfig builds with ARCH=arm and ARCH=arm64.

Changes in v3:
- Add MODULE_LICENSE in drivers

Changes in v2:
- Added depends on ARCH_K3 for the interrupt aggregator driver as it uses
64 bit ops

---
Nicolas Frayer (2):
irqchip: Kconfig: module build support for the TI interrupt router driver
irqchip: Kconfig: Added module build support for the TI interrupt aggregator

 arch/arm64/Kconfig.platforms      | 2 --
 drivers/irqchip/Kconfig           | 8 +++++---
 drivers/irqchip/irq-ti-sci-inta.c | 1 +
 drivers/irqchip/irq-ti-sci-intr.c | 1 +
 4 files changed, 7 insertions(+), 5 deletions(-)

---
base-commit: 2f87d0916ce0d2925cedbc9e8f5d6291ba2ac7b2
change-id: 20241016-timodules-174770215dd8

Best regards,

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

PATCH v3 1/2 irqchip: Kconfig: module build support for the TI interrupt router driver

From: Nicolas Frayer <[email protected]>

Added module build support in Kconfig for the TI SCI interrupt router driver

---
 arch/arm64/Kconfig.platforms      | 1 -
 drivers/irqchip/Kconfig           | 3 ++-
 drivers/irqchip/irq-ti-sci-intr.c | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)
arch/arm64/Kconfig.platforms +0 -1
index 6c6d11536b42..393845a3ae5c 100644
@@ -135,7 +135,6 @@ config ARCH_K3
 	select SOC_TI
 	select TI_MESSAGE_MANAGER
 	select TI_SCI_PROTOCOL
-	select TI_SCI_INTR_IRQCHIP
 	select TI_SCI_INTA_IRQCHIP
 	select TI_K3_SOCINFO
 	help
drivers/irqchip/Kconfig +2 -1
index 341cd9ca5a05..a958731404e9 100644
@@ -533,9 +533,10 @@ config LS1X_IRQ
 	  Support for the Loongson-1 platform Interrupt Controller.
 
 config TI_SCI_INTR_IRQCHIP
-	bool
+	tristate "TI SCI INTR Interrupt Controller"
 	depends on TI_SCI_PROTOCOL
 	select IRQ_DOMAIN_HIERARCHY
+	default ARCH_K3
 	help
 	  This enables the irqchip driver support for K3 Interrupt router
 	  over TI System Control Interface available on some new TI's SoCs.
drivers/irqchip/irq-ti-sci-intr.c +1 -0
index c027cd9e4a69..b49a73106c69 100644
@@ -303,3 +303,4 @@ module_platform_driver(ti_sci_intr_irq_domain_driver);
 
 MODULE_AUTHOR("Lokesh Vutla <lokeshvutla@ticom>");
 MODULE_DESCRIPTION("K3 Interrupt Router driver over TI SCI protocol");
+MODULE_LICENSE("GPL");
Signature · 1 line
2.34.1
#7 lore raw

PATCH v3 2/2 irqchip: Kconfig: Added module build support for the TI interrupt aggregator

In reply to Guillaume La Roque

From: Nicolas Frayer <[email protected]>

Added module build support in Kconfig for the TI SCI interrupt aggregator driver. The driver's default build is built-in and it also depends on ARCH_K3 as the driver uses some 64 bit ops and should only be built for 64 bit platforms.

---
 arch/arm64/Kconfig.platforms      | 1 -
 drivers/irqchip/Kconfig           | 5 +++--
 drivers/irqchip/irq-ti-sci-inta.c | 1 +
 3 files changed, 4 insertions(+), 3 deletions(-)
arch/arm64/Kconfig.platforms +0 -1
index 393845a3ae5c..9dea47decfbd 100644
@@ -135,7 +135,6 @@ config ARCH_K3
 	select SOC_TI
 	select TI_MESSAGE_MANAGER
 	select TI_SCI_PROTOCOL
-	select TI_SCI_INTA_IRQCHIP
 	select TI_K3_SOCINFO
 	help
 	  This enables support for Texas Instruments' K3 multicore SoC
drivers/irqchip/Kconfig +3 -2
index a958731404e9..9646322345e4 100644
@@ -544,10 +544,11 @@ config TI_SCI_INTR_IRQCHIP
 	  TI System Controller, say Y here. Otherwise, say N.
 
 config TI_SCI_INTA_IRQCHIP
-	bool
-	depends on TI_SCI_PROTOCOL
+	tristate "TI SCI INTA Interrupt Controller"
+	depends on ARCH_K3 && TI_SCI_PROTOCOL
 	select IRQ_DOMAIN_HIERARCHY
 	select TI_SCI_INTA_MSI_DOMAIN
+	default ARCH_K3
 	help
 	  This enables the irqchip driver support for K3 Interrupt aggregator
 	  over TI System Control Interface available on some new TI's SoCs.
drivers/irqchip/irq-ti-sci-inta.c +1 -0
index b83f5cbab123..a887efba262c 100644
@@ -743,3 +743,4 @@ module_platform_driver(ti_sci_inta_irq_domain_driver);
 
 MODULE_AUTHOR("Lokesh Vutla <[email protected]>");
 MODULE_DESCRIPTION("K3 Interrupt Aggregator driver over TI SCI protocol");
+MODULE_LICENSE("GPL");
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v3 1/2] irqchip: Kconfig: module build support for the TI interrupt router driver

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

From: Nicolas Frayer <[email protected]>

Added module build support in Kconfig for the TI SCI interrupt router driver

---
  arch/arm64/Kconfig.platforms      | 1 -
  drivers/irqchip/Kconfig           | 3 ++-
  drivers/irqchip/irq-ti-sci-intr.c | 1 +
  3 files changed, 3 insertions(+), 2 deletions(-)
arch/arm64/Kconfig.platforms +0 -1
index 6c6d11536b42..393845a3ae5c 100644
@@ -135,7 +135,6 @@ config ARCH_K3
  	select SOC_TI
  	select TI_MESSAGE_MANAGER
  	select TI_SCI_PROTOCOL
-	select TI_SCI_INTR_IRQCHIP
  	select TI_SCI_INTA_IRQCHIP
  	select TI_K3_SOCINFO
  	help
drivers/irqchip/Kconfig +0 -0
index 341cd9ca5a05..a958731404e9 100644

drivers/irqchip/Kconfig config LS1X_IRQ · line 536

Quoted 5 lines
drivers/irqchip/Kconfig +1 -1
@@ -533,9 +533,10 @@ config LS1X_IRQ
  	  Support for the Loongson-1 platform Interrupt Controller.
 
  config TI_SCI_INTR_IRQCHIP
-	bool
+	tristate "TI SCI INTR Interrupt Controller"

Although not needed, might be good to gate this on ARCH_K3 as it only makes sense to add when K3 is an enabled platform. Then add on compile test support:

depends on ARCH_K3 || COMPILE_TEST

Andrew

Quoted 16 lines
drivers/irqchip/Kconfig +1 -0
  	depends on TI_SCI_PROTOCOL
  	select IRQ_DOMAIN_HIERARCHY
+	default ARCH_K3
  	help
  	  This enables the irqchip driver support for K3 Interrupt router
  	  over TI System Control Interface available on some new TI's SoCs.
drivers/irqchip/irq-ti-sci-intr.c +1 -0
index c027cd9e4a69..b49a73106c69 100644
@@ -303,3 +303,4 @@ module_platform_driver(ti_sci_intr_irq_domain_driver);
 
  MODULE_AUTHOR("Lokesh Vutla <lokeshvutla@ticom>");
  MODULE_DESCRIPTION("K3 Interrupt Router driver over TI SCI protocol");
+MODULE_LICENSE("GPL");
#8 lore raw

Re: [PATCH v3 2/2] irqchip: Kconfig: Added module build support for the TI interrupt aggregator

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

From: Nicolas Frayer <[email protected]>

Added module build support in Kconfig for the TI SCI interrupt aggregator driver. The driver's default build is built-in and it also depends on ARCH_K3 as the driver uses some 64 bit ops and should only be built for 64 bit platforms.

---
  arch/arm64/Kconfig.platforms      | 1 -
  drivers/irqchip/Kconfig           | 5 +++--
  drivers/irqchip/irq-ti-sci-inta.c | 1 +
  3 files changed, 4 insertions(+), 3 deletions(-)
arch/arm64/Kconfig.platforms +0 -1
index 393845a3ae5c..9dea47decfbd 100644
@@ -135,7 +135,6 @@ config ARCH_K3
  	select SOC_TI
  	select TI_MESSAGE_MANAGER
  	select TI_SCI_PROTOCOL
-	select TI_SCI_INTA_IRQCHIP
  	select TI_K3_SOCINFO
  	help
  	  This enables support for Texas Instruments' K3 multicore SoC
drivers/irqchip/Kconfig +0 -0
index a958731404e9..9646322345e4 100644

drivers/irqchip/Kconfig config TI_SCI_INTR_IRQCHIP · line 548

Quoted 7 lines
drivers/irqchip/Kconfig +2 -2
@@ -544,10 +544,11 @@ config TI_SCI_INTR_IRQCHIP
  	  TI System Controller, say Y here. Otherwise, say N.
 
  config TI_SCI_INTA_IRQCHIP
-	bool
-	depends on TI_SCI_PROTOCOL
+	tristate "TI SCI INTA Interrupt Controller"
+	depends on ARCH_K3 && TI_SCI_PROTOCOL

You can still compile test, just gate it on 64BIT (or ARM64 if those 64bit ops are only available on ARM64).

depends on ARCH_K3 || (COMPILE_TEST && ARM64)

BTW, the last time this was posted the feedback was that if this was compiled as a module we might have issues with dependent drivers not having this IRQ ready as it may be loaded later. I think this would only cause probe defers if the drivers are well behaving, but something to double check.

Andrew

Quoted 16 lines
drivers/irqchip/Kconfig +1 -0
  	select IRQ_DOMAIN_HIERARCHY
  	select TI_SCI_INTA_MSI_DOMAIN
+	default ARCH_K3
  	help
  	  This enables the irqchip driver support for K3 Interrupt aggregator
  	  over TI System Control Interface available on some new TI's SoCs.
drivers/irqchip/irq-ti-sci-inta.c +1 -0
index b83f5cbab123..a887efba262c 100644
@@ -743,3 +743,4 @@ module_platform_driver(ti_sci_inta_irq_domain_driver);
 
  MODULE_AUTHOR("Lokesh Vutla <[email protected]>");
  MODULE_DESCRIPTION("K3 Interrupt Aggregator driver over TI SCI protocol");
+MODULE_LICENSE("GPL");
#3 lore raw

Re: [PATCH v3 1/2] irqchip: Kconfig: module build support for the TI interrupt router driver

In reply to Andrew Davis

Hi Andrew,

Le 16/10/2024 à 15:37, Andrew Davis a écrit :

Quoted 30 lines · Guillaume La Roque
Quoted 29 lines

From: Nicolas Frayer <[email protected]>

Added module build support in Kconfig for the TI SCI interrupt router driver

---
  arch/arm64/Kconfig.platforms      | 1 -
  drivers/irqchip/Kconfig           | 3 ++-
  drivers/irqchip/irq-ti-sci-intr.c | 1 +

  3 files changed, 3 insertions(+), 2 deletions(-)
arch/arm64/Kconfig.platforms +0 -0
index 6c6d11536b42..393845a3ae5c 100644
@@ -135,7 +135,6 @@ config ARCH_K3

      select SOC_TI
      select TI_MESSAGE_MANAGER
      select TI_SCI_PROTOCOL
-    select TI_SCI_INTR_IRQCHIP
      select TI_SCI_INTA_IRQCHIP
      select TI_K3_SOCINFO
      help

drivers/irqchip/Kconfig +0 -0
index 341cd9ca5a05..a958731404e9 100644
Quoted 8 lines
Quoted 5 lines
drivers/irqchip/Kconfig +0 -0
@@ -533,9 +533,10 @@ config LS1X_IRQ

        Support for the Loongson-1 platform Interrupt Controller. config TI_SCI_INTR_IRQCHIP
-    bool
+    tristate "TI SCI INTR Interrupt Controller"

Although not needed, might be good to gate this on ARCH_K3 as it only makes sense to add when K3 is an enabled platform.

Actually if ARCH_K3 is not selected it's not possible to enable TI IRQCHIP driver from menuconfig so depends look good or do you want to have when i select irqchip driver ARCH_K3 is enabled ?

Quoted 4 lines

Then add on compile test support:

depends on ARCH_K3 || COMPILE_TEST

i will add in v4.

thanks for review

Guillaume

Quoted 18 lines

Andrew

Quoted 16 lines

      depends on TI_SCI_PROTOCOL
      select IRQ_DOMAIN_HIERARCHY
+    default ARCH_K3
      help
        This enables the irqchip driver support for K3 Interrupt router over TI System Control Interface available on some new TI's SoCs.

drivers/irqchip/irq-ti-sci-intr.c +1 -0
index c027cd9e4a69..b49a73106c69 100644
@@ -303,3 +303,4 @@ 
 module_platform_driver(ti_sci_intr_irq_domain_driver);
     MODULE_AUTHOR("Lokesh Vutla <lokeshvutla@ticom>");
   MODULE_DESCRIPTION("K3 Interrupt Router driver over TI SCI protocol");
+MODULE_LICENSE("GPL");
#4 lore raw

Re: [PATCH v3 1/2] irqchip: Kconfig: module build support for the TI interrupt router driver

Quoted 42 lines · Guillaume LA ROQUE

Hi Andrew,

Le 16/10/2024 à 15:37, Andrew Davis a écrit :

Quoted 30 lines · Guillaume La Roque
Quoted 29 lines

From: Nicolas Frayer <[email protected]>

Added module build support in Kconfig for the TI SCI interrupt router driver

---
  arch/arm64/Kconfig.platforms      | 1 -
  drivers/irqchip/Kconfig           | 3 ++-
  drivers/irqchip/irq-ti-sci-intr.c | 1 +

  3 files changed, 3 insertions(+), 2 deletions(-)
arch/arm64/Kconfig.platforms +0 -0
index 6c6d11536b42..393845a3ae5c 100644
@@ -135,7 +135,6 @@ config ARCH_K3

      select SOC_TI
      select TI_MESSAGE_MANAGER
      select TI_SCI_PROTOCOL
-    select TI_SCI_INTR_IRQCHIP
      select TI_SCI_INTA_IRQCHIP
      select TI_K3_SOCINFO
      help

drivers/irqchip/Kconfig +0 -0
index 341cd9ca5a05..a958731404e9 100644
Quoted 8 lines
Quoted 5 lines
drivers/irqchip/Kconfig +0 -0
@@ -533,9 +533,10 @@ config LS1X_IRQ

        Support for the Loongson-1 platform Interrupt Controller. config TI_SCI_INTR_IRQCHIP
-    bool
+    tristate "TI SCI INTR Interrupt Controller"

Although not needed, might be good to gate this on ARCH_K3 as it only makes sense to add when K3 is an enabled platform.

Quoted 2 lines

Actually if ARCH_K3 is not selected it's not possible to enable TI IRQCHIP driver from menuconfig so depends look good or do you want to have when i select irqchip driver ARCH_K3 is enabled ?

Just adding the below "depends on" is fine, no need to select or change anything else.

Andrew

Quoted 27 lines
Quoted 4 lines

Then add on compile test support:

depends on ARCH_K3 || COMPILE_TEST

i will add in v4.

thanks for review

Guillaume

Quoted 17 lines

Andrew

Quoted 15 lines

      depends on TI_SCI_PROTOCOL
      select IRQ_DOMAIN_HIERARCHY
+    default ARCH_K3
      help
        This enables the irqchip driver support for K3 Interrupt router over TI System Control Interface available on some new TI's SoCs.

drivers/irqchip/irq-ti-sci-intr.c +1 -0
index c027cd9e4a69..b49a73106c69 100644
@@ -303,3 +303,4 @@ module_platform_driver(ti_sci_intr_irq_domain_driver);
     MODULE_AUTHOR("Lokesh Vutla <lokeshvutla@ticom>");
   MODULE_DESCRIPTION("K3 Interrupt Router driver over TI SCI protocol");
+MODULE_LICENSE("GPL");
 
#5 lore raw

Re: [PATCH v3 1/2] irqchip: Kconfig: module build support for the TI interrupt router driver

In reply to Guillaume La Roque
Quoted 1 line · Guillaume La Roque

From: Nicolas Frayer <[email protected]>

irqchip: Kconfig: is not a valid prefix.

This is about the TI SCI router, so this wants to use the irqchip/ti-whatever prefix.

Quoted 3 lines

Added module build support in Kconfig for the TI SCI interrupt router driver

Added?

This wants to be 'Add ...'

You fail to explain why it is valid to build this as a module, i.e. you did the analysis that there is no dependency on this before modules can be loaded.

Quoted 3 lines

MODULE_AUTHOR("Lokesh Vutla <lokeshvutla@ticom>"); MODULE_DESCRIPTION("K3 Interrupt Router driver over TI SCI protocol");
+MODULE_LICENSE("GPL");

This change is not mentioned in the change log.

Thanks,

tglx

#6 lore raw

Re: [PATCH v3 1/2] irqchip: Kconfig: module build support for the TI interrupt router driver

Hi ,

Le 16/10/2024 à 18:38, Thomas Gleixner a écrit :

Quoted 9 lines · Guillaume La Roque
Quoted 1 line

From: Nicolas Frayer <[email protected]>

irqchip: Kconfig: is not a valid prefix.

This is about the TI SCI router, so this wants to use the irqchip/ti-whatever prefix.

Quoted 2 lines

Added module build support in Kconfig for the TI SCI interrupt router driver

Quoted 7 lines

Added?

This wants to be 'Add ...'

You fail to explain why it is valid to build this as a module, i.e. you did the analysis that there is no dependency on this before modules can be loaded.

i will rewrite commit message and title .

Quoted 5 lines
Quoted 4 lines

MODULE_AUTHOR("Lokesh Vutla <lokeshvutla@ticom>"); MODULE_DESCRIPTION("K3 Interrupt Router driver over TI SCI protocol");
+MODULE_LICENSE("GPL");

This change is not mentioned in the change log.

it's mandatory for have possiblity to build in module so for me no really needed to explain this but i will add why in commit message.

thanks for review.

Guillaume

Quoted 4 lines

Thanks,

tglx

#9 lore raw

Re: [PATCH v3 2/2] irqchip: Kconfig: Added module build support for the TI interrupt aggregator

In reply to Andrew Davis

Le 16/10/2024 à 15:48, Andrew Davis a écrit :

Quoted 43 lines · Guillaume La Roque
Quoted 32 lines

From: Nicolas Frayer <[email protected]>

Added module build support in Kconfig for the TI SCI interrupt aggregator driver. The driver's default build is built-in and it also depends on ARCH_K3 as the driver uses some 64 bit ops and should only be built for 64 bit platforms.

---
  arch/arm64/Kconfig.platforms      | 1 -
  drivers/irqchip/Kconfig           | 5 +++--
  drivers/irqchip/irq-ti-sci-inta.c | 1 +

  3 files changed, 4 insertions(+), 3 deletions(-)
arch/arm64/Kconfig.platforms +0 -0
index 393845a3ae5c..9dea47decfbd 100644
@@ -135,7 +135,6 @@ config ARCH_K3

      select SOC_TI
      select TI_MESSAGE_MANAGER
      select TI_SCI_PROTOCOL
-    select TI_SCI_INTA_IRQCHIP
      select TI_K3_SOCINFO
      help
        This enables support for Texas Instruments' K3 multicore SoC

drivers/irqchip/Kconfig +0 -0
index a958731404e9..9646322345e4 100644
@@ -544,10 +544,11 @@ config TI_SCI_INTR_IRQCHIP
Quoted 6 lines

        TI System Controller, say Y here. Otherwise, say N. config TI_SCI_INTA_IRQCHIP
-    bool
-    depends on TI_SCI_PROTOCOL
+    tristate "TI SCI INTA Interrupt Controller"
+    depends on ARCH_K3 && TI_SCI_PROTOCOL

You can still compile test, just gate it on 64BIT (or ARM64 if those 64bit ops are only available on ARM64).

Quoted 7 lines

depends on ARCH_K3 || (COMPILE_TEST && ARM64)

BTW, the last time this was posted the feedback was that if this was compiled as a module we might have issues with dependent drivers not having this IRQ ready as it may be loaded later. I think this would only cause probe defers if the drivers are well behaving, but something to double check.

we already use this patch in android kernel mainline and 6.6 without issue to load all drivers.

i will try with your yocto sdk before post v4 to confirm it's still OK.

Guillaume

Quoted 19 lines

Andrew

Quoted 16 lines

      select IRQ_DOMAIN_HIERARCHY
      select TI_SCI_INTA_MSI_DOMAIN
+    default ARCH_K3
      help
        This enables the irqchip driver support for K3 Interrupt aggregator over TI System Control Interface available on some new TI's SoCs.

drivers/irqchip/irq-ti-sci-inta.c +1 -0
index b83f5cbab123..a887efba262c 100644
@@ -743,3 +743,4 @@ 
 module_platform_driver(ti_sci_inta_irq_domain_driver);
     MODULE_AUTHOR("Lokesh Vutla <[email protected]>");
   MODULE_DESCRIPTION("K3 Interrupt Aggregator driver over TI SCI protocol");
+MODULE_LICENSE("GPL");