patch-2.4.17 linux/kernel/printk.c
Next file: linux/kernel/ptrace.c
Previous file: linux/kernel/ksyms.c
Back to the patch index
Back to the overall index
- Lines: 34
- Date:
Fri Dec 21 16:40:33 2001
- Orig file:
linux-2.4.16/kernel/printk.c
- Orig date:
Sun Nov 11 18:20:21 2001
diff -Naur -X /home/marcelo/lib/dontdiff linux-2.4.16/kernel/printk.c linux/kernel/printk.c
@@ -38,6 +38,10 @@
#define LOG_BUF_MASK (LOG_BUF_LEN-1)
+#ifndef arch_consoles_callable
+#define arch_consoles_callable() (1)
+#endif
+
/* printk's without a loglevel use this.. */
#define DEFAULT_MESSAGE_LOGLEVEL 4 /* KERN_WARNING */
@@ -438,6 +442,14 @@
log_level_unknown = 1;
}
+ if (!arch_consoles_callable()) {
+ /*
+ * On some architectures, the consoles are not usable
+ * on secondary CPUs early in the boot process.
+ */
+ spin_unlock_irqrestore(&logbuf_lock, flags);
+ goto out;
+ }
if (!down_trylock(&console_sem)) {
/*
* We own the drivers. We can drop the spinlock and let
@@ -454,6 +466,7 @@
*/
spin_unlock_irqrestore(&logbuf_lock, flags);
}
+out:
return printed_len;
}
EXPORT_SYMBOL(printk);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)