All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clocksource: exynos-mct: Register the timer for stable udelay
@ 2014-06-18 11:31 ` Amit Daniel Kachhap
  0 siblings, 0 replies; 14+ messages in thread
From: Amit Daniel Kachhap @ 2014-06-18 11:31 UTC (permalink / raw)
  To: linux-samsung-soc, Kukjin Kim, Daniel Lezcano, Thomas Gleixner
  Cc: linux-arm-kernel, linux-kernel, David Riley, Doug Anderson,
	Tomasz Figa

This patch register the exynos mct clocksource as the current timer
as it has constant clock rate. This will generate correct udelay for the
exynos platform and avoid using unnecessary calibrated jiffies. This change
have been tested on exynos5420 based board.

Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
---

Patches from David Riley confirmed that udelay is broken in exynos5420.
Link to those patches are,
1) https://patchwork.kernel.org/patch/4344911/
2) https://patchwork.kernel.org/patch/4344881/

 drivers/clocksource/exynos_mct.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
index 8d64200..57cb3dc 100644
--- a/drivers/clocksource/exynos_mct.c
+++ b/drivers/clocksource/exynos_mct.c
@@ -198,10 +198,21 @@ static u64 notrace exynos4_read_sched_clock(void)
 	return exynos4_frc_read(&mct_frc);
 }
 
+static struct delay_timer exynos4_delay_timer;
+
+static unsigned long exynos4_read_current_timer(void)
+{
+	return exynos4_frc_read(&mct_frc);
+}
+
 static void __init exynos4_clocksource_init(void)
 {
 	exynos4_mct_frc_start(0, 0);
 
+	exynos4_delay_timer.read_current_timer = &exynos4_read_current_timer;
+	exynos4_delay_timer.freq = clk_rate;
+	register_current_timer_delay(&exynos4_delay_timer);
+
 	if (clocksource_register_hz(&mct_frc, clk_rate))
 		panic("%s: can't register clocksource\n", mct_frc.name);
 
-- 
1.9.1

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

end of thread, other threads:[~2014-06-19 16:17 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-18 11:31 [PATCH] clocksource: exynos-mct: Register the timer for stable udelay Amit Daniel Kachhap
2014-06-18 11:31 ` Amit Daniel Kachhap
2014-06-18 23:17 ` Doug Anderson
2014-06-18 23:17   ` Doug Anderson
2014-06-19  8:29   ` amit daniel kachhap
2014-06-19  8:29     ` amit daniel kachhap
2014-06-19  9:07   ` Daniel Lezcano
2014-06-19  9:07     ` Daniel Lezcano
2014-06-19 15:49     ` Doug Anderson
2014-06-19 15:49       ` Doug Anderson
2014-06-19 16:02       ` Daniel Lezcano
2014-06-19 16:02         ` Daniel Lezcano
2014-06-19 16:17         ` Doug Anderson
2014-06-19 16:17           ` Doug Anderson

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.