linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched_clock: fix postinit no sched_clock function check
@ 2013-10-02 16:55 Santosh Shilimkar
  2013-10-02 17:09 ` Will Deacon
  0 siblings, 1 reply; 11+ messages in thread
From: Santosh Shilimkar @ 2013-10-02 16:55 UTC (permalink / raw)
  To: linux-arm-kernel

The sched_clock code uses 2 levels of function pointers, sched_clock_func()
and read_sched_clock() but the no sched_clock check in postinit() just
checks read_sched_clock().

This leads to kernel falling back to jiffy based sched clock even in
presence of sched_clock_func() which is not desirable.

Fix the postinit() check to avoid the issue. Probably the issue is hidden
so far on most of the arm SOCs because of already existing sched_clock
registrations apart from arch_timer sched_clock. One can reproduce the
issue by just have arch_timer as sched_clock

Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Thomas Gleixner <tglx@linutronix.de>

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 kernel/time/sched_clock.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c
index 0b479a6..15c4d78 100644
--- a/kernel/time/sched_clock.c
+++ b/kernel/time/sched_clock.c
@@ -179,7 +179,8 @@ void __init sched_clock_postinit(void)
 	 * If no sched_clock function has been provided at that point,
 	 * make it the final one one.
 	 */
-	if (read_sched_clock == jiffy_sched_clock_read)
+	if ((read_sched_clock == jiffy_sched_clock_read) &&
+			(sched_clock_func == sched_clock_32))
 		setup_sched_clock(jiffy_sched_clock_read, 32, HZ);
 
 	sched_clock_poll(sched_clock_timer.data);
-- 
1.7.9.5

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

end of thread, other threads:[~2013-10-10  0:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-02 16:55 [PATCH] sched_clock: fix postinit no sched_clock function check Santosh Shilimkar
2013-10-02 17:09 ` Will Deacon
2013-10-02 17:14   ` Santosh Shilimkar
2013-10-02 17:22     ` Stephen Boyd
2013-10-02 17:27       ` Santosh Shilimkar
2013-10-02 17:42         ` Stephen Boyd
2013-10-02 17:48           ` Will Deacon
2013-10-02 18:07             ` Santosh Shilimkar
2013-10-09 23:59               ` John Stultz
2013-10-10  0:15                 ` Santosh Shilimkar
2013-10-02 18:14           ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).