mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] clocksource/drivers/imx-tpm: exclude sched clock for ARM64
@ 2022-01-05 12:43 Peng Fan (OSS)
  2022-02-16 12:29 ` Peng Fan
  2022-03-14  9:28 ` [tip: timers/core] clocksource/drivers/imx-tpm: Exclude " tip-bot2 for Peng Fan
  0 siblings, 2 replies; 3+ messages in thread
From: Peng Fan (OSS) @ 2022-01-05 12:43 UTC (permalink / raw)
  To: daniel.lezcano, tglx
  Cc: shawnguo, s.hauer, kernel, festevam, linux-imx, linux-kernel,
	linux-arm-kernel, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

For ARM64 platform such as i.MX8ULP which has ARMv8 generic timer as sched
clock, which is much faster compared with tpm sched clock. Reading the
tpm count register in i.MX8ULP requires about 290ns, this is slow and
introduce scheduler latency. So exclude tpm sched clock for ARM64
platform.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/clocksource/timer-imx-tpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/timer-imx-tpm.c b/drivers/clocksource/timer-imx-tpm.c
index 2cdc077a39f5..2bd530b9adc4 100644
--- a/drivers/clocksource/timer-imx-tpm.c
+++ b/drivers/clocksource/timer-imx-tpm.c
@@ -150,10 +150,10 @@ static int __init tpm_clocksource_init(void)
 	tpm_delay_timer.read_current_timer = &tpm_read_current_timer;
 	tpm_delay_timer.freq = timer_of_rate(&to_tpm) >> 3;
 	register_current_timer_delay(&tpm_delay_timer);
-#endif
 
 	sched_clock_register(tpm_read_sched_clock, counter_width,
 			     timer_of_rate(&to_tpm) >> 3);
+#endif
 
 	return clocksource_mmio_init(timer_base + TPM_CNT,
 				     "imx-tpm",
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] clocksource/drivers/imx-tpm: exclude sched clock for ARM64
  2022-01-05 12:43 [PATCH] clocksource/drivers/imx-tpm: exclude sched clock for ARM64 Peng Fan (OSS)
@ 2022-02-16 12:29 ` Peng Fan
  2022-03-14  9:28 ` [tip: timers/core] clocksource/drivers/imx-tpm: Exclude " tip-bot2 for Peng Fan
  1 sibling, 0 replies; 3+ messages in thread
From: Peng Fan @ 2022-02-16 12:29 UTC (permalink / raw)
  To: Peng Fan (OSS), daniel.lezcano, tglx
  Cc: shawnguo, s.hauer, kernel, festevam, dl-linux-imx, linux-kernel,
	linux-arm-kernel

> Subject: [PATCH] clocksource/drivers/imx-tpm: exclude sched clock for
> ARM64

Gentle ping..

Thanks,
Peng.

> 
> From: Peng Fan <peng.fan@nxp.com>
> 
> For ARM64 platform such as i.MX8ULP which has ARMv8 generic timer as
> sched clock, which is much faster compared with tpm sched clock. Reading
> the tpm count register in i.MX8ULP requires about 290ns, this is slow and
> introduce scheduler latency. So exclude tpm sched clock for ARM64 platform.
> 
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  drivers/clocksource/timer-imx-tpm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clocksource/timer-imx-tpm.c
> b/drivers/clocksource/timer-imx-tpm.c
> index 2cdc077a39f5..2bd530b9adc4 100644
> --- a/drivers/clocksource/timer-imx-tpm.c
> +++ b/drivers/clocksource/timer-imx-tpm.c
> @@ -150,10 +150,10 @@ static int __init tpm_clocksource_init(void)
>  	tpm_delay_timer.read_current_timer = &tpm_read_current_timer;
>  	tpm_delay_timer.freq = timer_of_rate(&to_tpm) >> 3;
>  	register_current_timer_delay(&tpm_delay_timer);
> -#endif
> 
>  	sched_clock_register(tpm_read_sched_clock, counter_width,
>  			     timer_of_rate(&to_tpm) >> 3);
> +#endif
> 
>  	return clocksource_mmio_init(timer_base + TPM_CNT,
>  				     "imx-tpm",
> --
> 2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip: timers/core] clocksource/drivers/imx-tpm: Exclude sched clock for ARM64
  2022-01-05 12:43 [PATCH] clocksource/drivers/imx-tpm: exclude sched clock for ARM64 Peng Fan (OSS)
  2022-02-16 12:29 ` Peng Fan
@ 2022-03-14  9:28 ` tip-bot2 for Peng Fan
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Peng Fan @ 2022-03-14  9:28 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Peng Fan, Daniel Lezcano, x86, linux-kernel

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     10720e120e2b1d66172dccb06eb4f346a665cca6
Gitweb:        https://git.kernel.org/tip/10720e120e2b1d66172dccb06eb4f346a665cca6
Author:        Peng Fan <peng.fan@nxp.com>
AuthorDate:    Wed, 05 Jan 2022 20:43:04 +08:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Wed, 16 Feb 2022 14:43:30 +01:00

clocksource/drivers/imx-tpm: Exclude sched clock for ARM64

For ARM64 platform such as i.MX8ULP which has ARMv8 generic timer as sched
clock, which is much faster compared with tpm sched clock. Reading the
tpm count register in i.MX8ULP requires about 290ns, this is slow and
introduce scheduler latency. So exclude tpm sched clock for ARM64
platform.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/20220105124304.3567629-1-peng.fan@oss.nxp.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/clocksource/timer-imx-tpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/timer-imx-tpm.c b/drivers/clocksource/timer-imx-tpm.c
index df80641..60cefc2 100644
--- a/drivers/clocksource/timer-imx-tpm.c
+++ b/drivers/clocksource/timer-imx-tpm.c
@@ -150,10 +150,10 @@ static int __init tpm_clocksource_init(void)
 	tpm_delay_timer.read_current_timer = &tpm_read_current_timer;
 	tpm_delay_timer.freq = timer_of_rate(&to_tpm) >> 3;
 	register_current_timer_delay(&tpm_delay_timer);
-#endif
 
 	sched_clock_register(tpm_read_sched_clock, counter_width,
 			     timer_of_rate(&to_tpm) >> 3);
+#endif
 
 	return clocksource_mmio_init(timer_base + TPM_CNT,
 				     "imx-tpm",

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-14  9:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-05 12:43 [PATCH] clocksource/drivers/imx-tpm: exclude sched clock for ARM64 Peng Fan (OSS)
2022-02-16 12:29 ` Peng Fan
2022-03-14  9:28 ` [tip: timers/core] clocksource/drivers/imx-tpm: Exclude " tip-bot2 for Peng Fan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®