]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Fix CONFIG_PRINTK_TIME
authorTony Lindgren <tony@atomide.com>
Thu, 15 Jun 2006 01:26:39 +0000 (18:26 -0700)
committerTony Lindgren <tony@atomide.com>
Thu, 15 Jun 2006 01:26:39 +0000 (18:26 -0700)
Fix CONFIG_PRINTK_TIME hangs on systems where sched_clock() does
not work before timer is initialized.

For example, on OMAP, symptoms of this problem include system
only booting with low level debug enabled when using 32KHz timer.

Signed-off-by: Tony Lindgren <tony@atomide.com>
kernel/printk.c

index e4e0407e432017368248aa1633900eb89174724f..99d259fa5891989dce138b7c01c597d359eddf31 100644 (file)
@@ -435,11 +435,23 @@ static void zap_locks(void)
        init_MUTEX(&console_sem);
 }
 
-#if defined(CONFIG_PRINTK_TIME)
-static int printk_time = 1;
-#else
 static int printk_time = 0;
-#endif
+
+#ifdef CONFIG_PRINTK_TIME
+
+/*
+ * Initialize printk time. Note that on some systems sched_clock()
+ * does not work until timer is initialized.
+ */
+static int __init printk_time_init(void)
+{
+       printk_time = 1;
+
+       return 0;
+}
+subsys_initcall(printk_time_init);
+
+#else
 
 static int __init printk_time_setup(char *str)
 {
@@ -451,6 +463,8 @@ static int __init printk_time_setup(char *str)
 
 __setup("time", printk_time_setup);
 
+#endif
+
 __attribute__((weak)) unsigned long long printk_clock(void)
 {
        return sched_clock();