diff mbox series

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

Message ID 20241016-timodules-v3-2-fa71091ade98@baylibre.com (mailing list archive)
State New, archived
Headers show
Series irqchip: Kconfig: Add module support for TI inta/intr | expand

Commit Message

Guillaume LA ROQUE Oct. 16, 2024, 9:41 a.m. UTC
From: Nicolas Frayer <nfrayer@baylibre.com>

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.

Signed-off-by: Nicolas Frayer <nfrayer@baylibre.com>
Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
---
 arch/arm64/Kconfig.platforms      | 1 -
 drivers/irqchip/Kconfig           | 5 +++--
 drivers/irqchip/irq-ti-sci-inta.c | 1 +
 3 files changed, 4 insertions(+), 3 deletions(-)

Comments

Andrew Davis Oct. 16, 2024, 1:48 p.m. UTC | #1
On 10/16/24 4:41 AM, Guillaume La Roque wrote:
> From: Nicolas Frayer <nfrayer@baylibre.com>
> 
> 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.
> 
> Signed-off-by: Nicolas Frayer <nfrayer@baylibre.com>
> Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
> ---
>   arch/arm64/Kconfig.platforms      | 1 -
>   drivers/irqchip/Kconfig           | 5 +++--
>   drivers/irqchip/irq-ti-sci-inta.c | 1 +
>   3 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
> index 393845a3ae5c..9dea47decfbd 100644
> --- a/arch/arm64/Kconfig.platforms
> +++ b/arch/arm64/Kconfig.platforms
> @@ -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
> diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
> index a958731404e9..9646322345e4 100644
> --- a/drivers/irqchip/Kconfig
> +++ b/drivers/irqchip/Kconfig
> @@ -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

>   	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.
> diff --git a/drivers/irqchip/irq-ti-sci-inta.c b/drivers/irqchip/irq-ti-sci-inta.c
> index b83f5cbab123..a887efba262c 100644
> --- a/drivers/irqchip/irq-ti-sci-inta.c
> +++ b/drivers/irqchip/irq-ti-sci-inta.c
> @@ -743,3 +743,4 @@ module_platform_driver(ti_sci_inta_irq_domain_driver);
>   
>   MODULE_AUTHOR("Lokesh Vutla <lokeshvutla@ti.com>");
>   MODULE_DESCRIPTION("K3 Interrupt Aggregator driver over TI SCI protocol");
> +MODULE_LICENSE("GPL");
>
Guillaume LA ROQUE Oct. 18, 2024, 8:01 a.m. UTC | #2
Le 16/10/2024 à 15:48, Andrew Davis a écrit :
> On 10/16/24 4:41 AM, Guillaume La Roque wrote:
>> From: Nicolas Frayer <nfrayer@baylibre.com>
>>
>> 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.
>>
>> Signed-off-by: Nicolas Frayer <nfrayer@baylibre.com>
>> Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
>> ---
>>   arch/arm64/Kconfig.platforms      | 1 -
>>   drivers/irqchip/Kconfig           | 5 +++--
>>   drivers/irqchip/irq-ti-sci-inta.c | 1 +
>>   3 files changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
>> index 393845a3ae5c..9dea47decfbd 100644
>> --- a/arch/arm64/Kconfig.platforms
>> +++ b/arch/arm64/Kconfig.platforms
>> @@ -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
>> diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
>> index a958731404e9..9646322345e4 100644
>> --- a/drivers/irqchip/Kconfig
>> +++ b/drivers/irqchip/Kconfig
>> @@ -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.


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

>
> Andrew
>
>>       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.
>> diff --git a/drivers/irqchip/irq-ti-sci-inta.c 
>> b/drivers/irqchip/irq-ti-sci-inta.c
>> index b83f5cbab123..a887efba262c 100644
>> --- a/drivers/irqchip/irq-ti-sci-inta.c
>> +++ b/drivers/irqchip/irq-ti-sci-inta.c
>> @@ -743,3 +743,4 @@ 
>> module_platform_driver(ti_sci_inta_irq_domain_driver);
>>     MODULE_AUTHOR("Lokesh Vutla <lokeshvutla@ti.com>");
>>   MODULE_DESCRIPTION("K3 Interrupt Aggregator driver over TI SCI 
>> protocol");
>> +MODULE_LICENSE("GPL");
>>
diff mbox series

Patch

diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index 393845a3ae5c..9dea47decfbd 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -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
diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
index a958731404e9..9646322345e4 100644
--- a/drivers/irqchip/Kconfig
+++ b/drivers/irqchip/Kconfig
@@ -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.
diff --git a/drivers/irqchip/irq-ti-sci-inta.c b/drivers/irqchip/irq-ti-sci-inta.c
index b83f5cbab123..a887efba262c 100644
--- a/drivers/irqchip/irq-ti-sci-inta.c
+++ b/drivers/irqchip/irq-ti-sci-inta.c
@@ -743,3 +743,4 @@  module_platform_driver(ti_sci_inta_irq_domain_driver);
 
 MODULE_AUTHOR("Lokesh Vutla <lokeshvutla@ti.com>");
 MODULE_DESCRIPTION("K3 Interrupt Aggregator driver over TI SCI protocol");
+MODULE_LICENSE("GPL");