All of lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
To: Will Deacon <will@kernel.org>, linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Daniel Lezcano <daniel.lezcano@linaro.org>
Subject: Re: [PATCH 1/2] clocksource/drivers/exynos_mct: Prioritise Arm arch timer on arm64
Date: Wed, 9 Jun 2021 13:41:33 +0200	[thread overview]
Message-ID: <7a3213a4-5f35-17b3-3d05-a5c6f032d1f5@canonical.com> (raw)
In-Reply-To: <20210608154341.10794-2-will@kernel.org>

On 08/06/2021 17:43, Will Deacon wrote:
> All arm64 CPUs feature an architected timer, which offers a relatively
> low-latency interface to a per-cpu clocksource and timer. For the most
> part, using this interface is a no-brainer, with the exception of SoCs
> where it cannot be used to wake up from deep idle state (i.e.
> CLOCK_EVT_FEAT_C3STOP is set).
> 
> On the contrary, the Exynos MCT is extremely slow to access yet can be
> used as a wakeup source. In preparation for using the Exynos MCT as a
> potential wakeup timer for the Arm architected timer, reduce its ratings
> so that the architected timer is preferred.
> 
> This effectively reverts the decision made in 6282edb72bed
> ("clocksource/drivers/exynos_mct: Increase priority over ARM arch timer")
> for arm64, as the reasoning for the original change was to work around
> a 32-bit SoC design.
> 
> Cc: Marek Szyprowski <m.szyprowski@samsung.com>
> Cc: Krzysztof Kozlowski <krzk@kernel.org>
> Cc: Chanwoo Choi <cw00.choi@samsung.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Will Deacon <will@kernel.org>
> ---
>  drivers/clocksource/exynos_mct.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
> index fabad79baafc..804d3e01c8f4 100644
> --- a/drivers/clocksource/exynos_mct.c
> +++ b/drivers/clocksource/exynos_mct.c
> @@ -51,6 +51,15 @@
>  
>  #define TICK_BASE_CNT	1
>  
> +#ifdef CONFIG_ARM
> +/* Use values higher than ARM arch timer. See 6282edb72bed. */
> +#define MCT_CLKSOURCE_RATING		450
> +#define MCT_CLKEVENTS_RATING		500
> +#else
> +#define MCT_CLKSOURCE_RATING		350
> +#define MCT_CLKEVENTS_RATING		350
> +#endif
> +

Tested on Exynos5422 (32-bit ARM) and it seems to work. I don't have
ARMv8 board to check it. We want Exynos MCT on ARMv8 as well, because
unfortunately it shares the block with Arch timer. This was investigated
by Marek:
https://lore.kernel.org/linux-samsung-soc/20181017123622eucas1p14654c89a8590fd094d638b60ab9af8f0~eZY3j27rs0422004220eucas1p1M@eucas1p1.samsung.com/

Best regards,
Krzysztof

WARNING: multiple messages have this Message-ID (diff)
From: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
To: Will Deacon <will@kernel.org>, linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Daniel Lezcano <daniel.lezcano@linaro.org>
Subject: Re: [PATCH 1/2] clocksource/drivers/exynos_mct: Prioritise Arm arch timer on arm64
Date: Wed, 9 Jun 2021 13:41:33 +0200	[thread overview]
Message-ID: <7a3213a4-5f35-17b3-3d05-a5c6f032d1f5@canonical.com> (raw)
In-Reply-To: <20210608154341.10794-2-will@kernel.org>

On 08/06/2021 17:43, Will Deacon wrote:
> All arm64 CPUs feature an architected timer, which offers a relatively
> low-latency interface to a per-cpu clocksource and timer. For the most
> part, using this interface is a no-brainer, with the exception of SoCs
> where it cannot be used to wake up from deep idle state (i.e.
> CLOCK_EVT_FEAT_C3STOP is set).
> 
> On the contrary, the Exynos MCT is extremely slow to access yet can be
> used as a wakeup source. In preparation for using the Exynos MCT as a
> potential wakeup timer for the Arm architected timer, reduce its ratings
> so that the architected timer is preferred.
> 
> This effectively reverts the decision made in 6282edb72bed
> ("clocksource/drivers/exynos_mct: Increase priority over ARM arch timer")
> for arm64, as the reasoning for the original change was to work around
> a 32-bit SoC design.
> 
> Cc: Marek Szyprowski <m.szyprowski@samsung.com>
> Cc: Krzysztof Kozlowski <krzk@kernel.org>
> Cc: Chanwoo Choi <cw00.choi@samsung.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Will Deacon <will@kernel.org>
> ---
>  drivers/clocksource/exynos_mct.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
> index fabad79baafc..804d3e01c8f4 100644
> --- a/drivers/clocksource/exynos_mct.c
> +++ b/drivers/clocksource/exynos_mct.c
> @@ -51,6 +51,15 @@
>  
>  #define TICK_BASE_CNT	1
>  
> +#ifdef CONFIG_ARM
> +/* Use values higher than ARM arch timer. See 6282edb72bed. */
> +#define MCT_CLKSOURCE_RATING		450
> +#define MCT_CLKEVENTS_RATING		500
> +#else
> +#define MCT_CLKSOURCE_RATING		350
> +#define MCT_CLKEVENTS_RATING		350
> +#endif
> +

Tested on Exynos5422 (32-bit ARM) and it seems to work. I don't have
ARMv8 board to check it. We want Exynos MCT on ARMv8 as well, because
unfortunately it shares the block with Arch timer. This was investigated
by Marek:
https://lore.kernel.org/linux-samsung-soc/20181017123622eucas1p14654c89a8590fd094d638b60ab9af8f0~eZY3j27rs0422004220eucas1p1M@eucas1p1.samsung.com/

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-06-09 11:42 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 15:43 [PATCH 0/2] Use Exynos-MCT timer as wakeup for Arm arch timer Will Deacon
2021-06-08 15:43 ` Will Deacon
2021-06-08 15:43 ` [PATCH 1/2] clocksource/drivers/exynos_mct: Prioritise Arm arch timer on arm64 Will Deacon
2021-06-08 15:43   ` Will Deacon
2021-06-09 11:41   ` Krzysztof Kozlowski [this message]
2021-06-09 11:41     ` Krzysztof Kozlowski
2021-06-10  1:03   ` Chanwoo Choi
2021-06-10  1:03     ` Chanwoo Choi
2021-06-16 15:25     ` Daniel Lezcano
2021-06-16 15:25       ` Daniel Lezcano
2021-06-17  0:58       ` Chanwoo Choi
2021-06-17  0:58         ` Chanwoo Choi
2021-06-17 21:47         ` Will Deacon
2021-06-17 21:47           ` Will Deacon
2021-06-21  9:25           ` Daniel Lezcano
2021-06-21  9:25             ` Daniel Lezcano
2021-06-21 10:10             ` Will Deacon
2021-06-21 10:10               ` Will Deacon
2021-06-21 10:18               ` Daniel Lezcano
2021-06-21 10:18                 ` Daniel Lezcano
2021-06-22  2:40                 ` Chanwoo Choi
2021-06-22  2:40                   ` Chanwoo Choi
2021-06-22  5:21                   ` Daniel Lezcano
2021-06-22  5:21                     ` Daniel Lezcano
2021-06-22  6:42                     ` Chanwoo Choi
2021-06-22  6:42                       ` Chanwoo Choi
2021-06-21 10:17             ` Marek Szyprowski
2021-06-21 10:17               ` Marek Szyprowski
2021-06-21 10:24               ` Daniel Lezcano
2021-06-21 10:24                 ` Daniel Lezcano
2021-08-26 16:25   ` [tip: timers/core] " tip-bot2 for Will Deacon
2021-06-08 15:43 ` [PATCH 2/2] clocksource/drivers/exynos_mct: Mark MCT device as CLOCK_EVT_FEAT_PERCPU Will Deacon
2021-06-08 15:43   ` Will Deacon
2021-06-09 11:41   ` Krzysztof Kozlowski
2021-06-09 11:41     ` Krzysztof Kozlowski
2021-06-17  0:59   ` Chanwoo Choi
2021-06-17  0:59     ` Chanwoo Choi
2021-08-26 16:25   ` [tip: timers/core] " tip-bot2 for Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a3213a4-5f35-17b3-3d05-a5c6f032d1f5@canonical.com \
    --to=krzysztof.kozlowski@canonical.com \
    --cc=cw00.choi@samsung.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.