lkml.org 
[lkml]   [2006]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Fix CONFIG_PRINTK_TIME hangs on some systems
Hi all,

This issue has been discussed earlier on LKML, but AFAIK
there has not been any better solution available:

http://lkml.org/lkml/2005/8/18/173

Regards,

Tony
Fix CONFIG_PRINTK_TIME hangs on systems where sched_clock() does
not work before timer is initialized.

Signed-off-by: Tony Lindgren <tony@atomide.com>

--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -431,11 +431,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)
{
@@ -447,6 +459,8 @@ static int __init printk_time_setup(char

__setup("time", printk_time_setup);

+#endif
+
__attribute__((weak)) unsigned long long printk_clock(void)
{
return sched_clock();
\
 
 \ /
  Last update: 2006-05-04 12:26    [W:0.025 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site