Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754813Ab3JBQ4c (ORCPT ); Wed, 2 Oct 2013 12:56:32 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:47732 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753497Ab3JBQ4b (ORCPT ); Wed, 2 Oct 2013 12:56:31 -0400 From: Santosh Shilimkar To: CC: , , Santosh Shilimkar , Stephen Boyd , John Stultz , Russell King , Will Deacon , Rob Herring , Thomas Gleixner Subject: [PATCH] sched_clock: fix postinit no sched_clock function check Date: Wed, 2 Oct 2013 12:55:28 -0400 Message-ID: <1380732928-13897-1-git-send-email-santosh.shilimkar@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1785 Lines: 46 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 Cc: John Stultz Cc: Russell King Cc: Will Deacon Cc: Rob Herring Cc: Thomas Gleixner Signed-off-by: Santosh Shilimkar --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/