mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RT 2/3] initialize the clock source to jiffies clock.
@ 2007-08-24 17:57 Steven Rostedt
  0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2007-08-24 17:57 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: LKML, RT, Thomas Gleixner, john stultz

The latency tracer can call clocksource_read very early in bootup and
before the clock source variable has been initialized. This results in a
crash at boot up (even before earlyprintk is initialized). Since the
clock->read variable is points to NULL.

This patch simply initializes the clock to use clocksource_jiffies, so
that any early user of clocksource_read will not crash.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

Index: linux-2.6-rt/kernel/time/timekeeping.c
===================================================================
--- linux-2.6-rt.orig/kernel/time/timekeeping.c	2007-08-24 11:38:11.000000000 -0400
+++ linux-2.6-rt/kernel/time/timekeeping.c	2007-08-24 13:41:03.000000000 -0400
@@ -43,7 +43,15 @@ struct timespec wall_to_monotonic __attr
 EXPORT_SYMBOL(xtime);
 
 
-static struct clocksource *clock; /* pointer to current clocksource */
+extern struct clocksource clocksource_jiffies;
+
+/*
+ * pointer to current clocksource
+ *  Just in case we use clocksource_read before we initialize
+ *  the actual clock source. Instead of calling a NULL read pointer
+ *  we return jiffies.
+ */
+static struct clocksource *clock = &clocksource_jiffies;
 
 
 #ifdef CONFIG_GENERIC_TIME



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-08-24 17:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-24 17:57 [PATCH RT 2/3] initialize the clock source to jiffies clock Steven Rostedt

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®