diff mbox series

[RESEND,6/6] arm64: exynos: Enable Exynos Multi-Core Timer driver

Message ID 20211220165004.17005-2-krzysztof.kozlowski@canonical.com (mailing list archive)
State Queued
Headers show
Series None | expand

Commit Message

Krzysztof Kozlowski Dec. 20, 2021, 4:50 p.m. UTC
From: Marek Szyprowski <m.szyprowski@samsung.com>

Some ARM64 Exynos SoCs have MCT timer block, e.g. Exynos850 and
Exynos5433. CLKSRC_EXYNOS_MCT option is not visible unless COMPILE_TEST
is enabled. Select CLKSRC_EXYNOS_MCT option for ARM64 ARCH_EXYNOS like
it's done in arch/arm/mach-exynos/Kconfig, to enable MCT timer support
for ARM64 Exynos SoCs.

Even though ARM architected timer is available on all ARM64 SoCs, and
used for managing timer hardware and clock source events, MCT timer
still can be used as a wakeup source, as stated in commitae460fd9164b
("clocksource/drivers/exynos_mct: Prioritise Arm arch timer on arm64").
It's also nice to be able to test available MCT IP-core.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Link: https://lore.kernel.org/r/20211101193531.15078-3-semen.protsenko@linaro.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
---
 arch/arm64/Kconfig.platforms | 1 +
 1 file changed, 1 insertion(+)

Comments

Arnd Bergmann Dec. 21, 2021, 12:30 p.m. UTC | #1
On Mon, Dec 20, 2021 at 5:50 PM Krzysztof Kozlowski
<krzysztof.kozlowski@canonical.com> wrote:
> From: Marek Szyprowski <m.szyprowski@samsung.com>
>
> diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
> index 1aa8b7073218..91f5e9568122 100644
> --- a/arch/arm64/Kconfig.platforms
> +++ b/arch/arm64/Kconfig.platforms
> @@ -89,6 +89,7 @@ config ARCH_BRCMSTB
>  config ARCH_EXYNOS
>         bool "ARMv8 based Samsung Exynos SoC family"
>         select COMMON_CLK_SAMSUNG
> +       select CLKSRC_EXYNOS_MCT
>         select EXYNOS_PM_DOMAINS if PM_GENERIC_DOMAINS
>         select EXYNOS_PMU
>         select PINCTRL


I applied this, but I don't think this is the best way to do it. As
you describe, the
driver is optional, and we probably shouldn't force-enable it here just because
we build a kernel that may run on a platform that may want to use this.

I understand the clocksource maintainers prefer the 'select' method, but I think
this one shows why that doesn't always work well. This is probably even an
example of a clocksource driver that could be a loadable module if someone
did the work to make this possible.

        Arnd
Krzysztof Kozlowski Dec. 22, 2021, 4:04 p.m. UTC | #2
On 21/12/2021 13:30, Arnd Bergmann wrote:
> On Mon, Dec 20, 2021 at 5:50 PM Krzysztof Kozlowski
> <krzysztof.kozlowski@canonical.com> wrote:
>> From: Marek Szyprowski <m.szyprowski@samsung.com>
>>
>> diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
>> index 1aa8b7073218..91f5e9568122 100644
>> --- a/arch/arm64/Kconfig.platforms
>> +++ b/arch/arm64/Kconfig.platforms
>> @@ -89,6 +89,7 @@ config ARCH_BRCMSTB
>>  config ARCH_EXYNOS
>>         bool "ARMv8 based Samsung Exynos SoC family"
>>         select COMMON_CLK_SAMSUNG
>> +       select CLKSRC_EXYNOS_MCT
>>         select EXYNOS_PM_DOMAINS if PM_GENERIC_DOMAINS
>>         select EXYNOS_PMU
>>         select PINCTRL
> 
> 
> I applied this, but I don't think this is the best way to do it. As
> you describe, the
> driver is optional, and we probably shouldn't force-enable it here just because
> we build a kernel that may run on a platform that may want to use this.

All older ARMv8 designs actually require this because Architected timer
is sharing block with MCT. The newer designs (not supported yet) could
indeed skip it and rely on Architected entirely.

> 
> I understand the clocksource maintainers prefer the 'select' method, but I think
> this one shows why that doesn't always work well. This is probably even an
> example of a clocksource driver that could be a loadable module if someone
> did the work to make this possible.

I understand. Maybe it is the time to make the timer user-visible option
with default value. Probably several other timers could be converted to
such approach as well.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index 1aa8b7073218..91f5e9568122 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -89,6 +89,7 @@  config ARCH_BRCMSTB
 config ARCH_EXYNOS
 	bool "ARMv8 based Samsung Exynos SoC family"
 	select COMMON_CLK_SAMSUNG
+	select CLKSRC_EXYNOS_MCT
 	select EXYNOS_PM_DOMAINS if PM_GENERIC_DOMAINS
 	select EXYNOS_PMU
 	select PINCTRL