All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>,
	Will Deacon <will@kernel.org>,
	Chanwoo Choi <cw00.choi@samsung.com>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 1/2] clocksource/drivers/exynos_mct: Prioritise Arm arch timer on arm64
Date: Mon, 21 Jun 2021 12:17:41 +0200	[thread overview]
Message-ID: <95fb8ea3-f409-55ee-6b5c-f19858dd0fab@samsung.com> (raw)
In-Reply-To: <d79ebd58-1c4e-834c-fc06-482f25f6f3de@linaro.org>

Hi Daniel,

On 21.06.2021 11:25, Daniel Lezcano wrote:
> On 17/06/2021 23:47, Will Deacon wrote:
>> On Thu, Jun 17, 2021 at 09:58:35AM +0900, Chanwoo Choi wrote:
>>> On 6/17/21 12:25 AM, Daniel Lezcano wrote:
>>>> On 10/06/2021 03:03, Chanwoo Choi wrote:
>>>>> On 6/9/21 12:43 AM, Will Deacon wrote:
>>>>>> 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
>>>>>> +
>>>>>>   enum {
>>>>>>   	MCT_INT_SPI,
>>>>>>   	MCT_INT_PPI
>>>>>> @@ -206,7 +215,7 @@ static void exynos4_frc_resume(struct clocksource *cs)
>>>>>>   
>>>>>>   static struct clocksource mct_frc = {
>>>>>>   	.name		= "mct-frc",
>>>>>> -	.rating		= 450,	/* use value higher than ARM arch timer */
>>>>>> +	.rating		= MCT_CLKSOURCE_RATING,
>>>>>>   	.read		= exynos4_frc_read,
>>>>>>   	.mask		= CLOCKSOURCE_MASK(32),
>>>>>>   	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
>>>>>> @@ -457,7 +466,7 @@ static int exynos4_mct_starting_cpu(unsigned int cpu)
>>>>>>   	evt->set_state_oneshot_stopped = set_state_shutdown;
>>>>>>   	evt->tick_resume = set_state_shutdown;
>>>>>>   	evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
>>>>>> -	evt->rating = 500;	/* use value higher than ARM arch timer */
>>>>>> +	evt->rating = MCT_CLKEVENTS_RATING,
>>>>>>   
>>>>>>   	exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET);
>>>>>>   
>>>>>>
>>>>> I'm not sure that exynos mct is working without problem
>>>>> such as the case of 6282edb72bed.
>>>>> As described on On ,6282edb72bed the arch timer on exynos SoC
>>>>> depends on Exynos MCT device. the arch timer is not able to work
>>>>> without Exynos MCT because of using the common module.
>>>> Is it possible to change the DT to have a phandle to the exynos_mct, so
>>>> it will be probed before the arch_arm_timer ?
>>> I think that DT changes is not proper way to keep the order between
>>> exynos_mct and arch timer.
>> exynos4_mct_frc_start() is called unconditionally from probe via
>> exynos4_clocksource_init() so as long as the mct probes first, then the
>> arch timer should work, no? The rating shouldn't affect that.
> How do you ensure the exynos mct is probed before the arch timer ?
>
> The Makefile provides the right order, but the dependency is implicit.

In my test systems based on Exynos5433, the bootloader enabled MCT, so 
kernel can also start with arch_timer then switch to MCT. The probe 
order also depend on the order of DT nodes, so with the current dts MCT 
is probed first. This is not the best approach, but so far it works.

Best regards

-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


WARNING: multiple messages have this Message-ID (diff)
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>,
	Will Deacon <will@kernel.org>,
	Chanwoo Choi <cw00.choi@samsung.com>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 1/2] clocksource/drivers/exynos_mct: Prioritise Arm arch timer on arm64
Date: Mon, 21 Jun 2021 12:17:41 +0200	[thread overview]
Message-ID: <95fb8ea3-f409-55ee-6b5c-f19858dd0fab@samsung.com> (raw)
In-Reply-To: <d79ebd58-1c4e-834c-fc06-482f25f6f3de@linaro.org>

Hi Daniel,

On 21.06.2021 11:25, Daniel Lezcano wrote:
> On 17/06/2021 23:47, Will Deacon wrote:
>> On Thu, Jun 17, 2021 at 09:58:35AM +0900, Chanwoo Choi wrote:
>>> On 6/17/21 12:25 AM, Daniel Lezcano wrote:
>>>> On 10/06/2021 03:03, Chanwoo Choi wrote:
>>>>> On 6/9/21 12:43 AM, Will Deacon wrote:
>>>>>> 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
>>>>>> +
>>>>>>   enum {
>>>>>>   	MCT_INT_SPI,
>>>>>>   	MCT_INT_PPI
>>>>>> @@ -206,7 +215,7 @@ static void exynos4_frc_resume(struct clocksource *cs)
>>>>>>   
>>>>>>   static struct clocksource mct_frc = {
>>>>>>   	.name		= "mct-frc",
>>>>>> -	.rating		= 450,	/* use value higher than ARM arch timer */
>>>>>> +	.rating		= MCT_CLKSOURCE_RATING,
>>>>>>   	.read		= exynos4_frc_read,
>>>>>>   	.mask		= CLOCKSOURCE_MASK(32),
>>>>>>   	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
>>>>>> @@ -457,7 +466,7 @@ static int exynos4_mct_starting_cpu(unsigned int cpu)
>>>>>>   	evt->set_state_oneshot_stopped = set_state_shutdown;
>>>>>>   	evt->tick_resume = set_state_shutdown;
>>>>>>   	evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
>>>>>> -	evt->rating = 500;	/* use value higher than ARM arch timer */
>>>>>> +	evt->rating = MCT_CLKEVENTS_RATING,
>>>>>>   
>>>>>>   	exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET);
>>>>>>   
>>>>>>
>>>>> I'm not sure that exynos mct is working without problem
>>>>> such as the case of 6282edb72bed.
>>>>> As described on On ,6282edb72bed the arch timer on exynos SoC
>>>>> depends on Exynos MCT device. the arch timer is not able to work
>>>>> without Exynos MCT because of using the common module.
>>>> Is it possible to change the DT to have a phandle to the exynos_mct, so
>>>> it will be probed before the arch_arm_timer ?
>>> I think that DT changes is not proper way to keep the order between
>>> exynos_mct and arch timer.
>> exynos4_mct_frc_start() is called unconditionally from probe via
>> exynos4_clocksource_init() so as long as the mct probes first, then the
>> arch timer should work, no? The rating shouldn't affect that.
> How do you ensure the exynos mct is probed before the arch timer ?
>
> The Makefile provides the right order, but the dependency is implicit.

In my test systems based on Exynos5433, the bootloader enabled MCT, so 
kernel can also start with arch_timer then switch to MCT. The probe 
order also depend on the order of DT nodes, so with the current dts MCT 
is probed first. This is not the best approach, but so far it works.

Best regards

-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


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

  parent reply	other threads:[~2021-06-21 10:17 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
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 [this message]
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=95fb8ea3-f409-55ee-6b5c-f19858dd0fab@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=cw00.choi@samsung.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=krzk@kernel.org \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --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.