Commit 139ca9be authored by David Mosberger's avatar David Mosberger Committed by Linus Torvalds

[PATCH] arch_consoles_callable() macro

Here is the patch to add the arch_consoles_callable() macro as was done
in the 2.4 tree.
parent feef9b8a
...@@ -39,6 +39,10 @@ ...@@ -39,6 +39,10 @@
#define LOG_BUF_MASK (LOG_BUF_LEN-1) #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.. */ /* printk's without a loglevel use this.. */
#define DEFAULT_MESSAGE_LOGLEVEL 4 /* KERN_WARNING */ #define DEFAULT_MESSAGE_LOGLEVEL 4 /* KERN_WARNING */
...@@ -439,6 +443,14 @@ asmlinkage int printk(const char *fmt, ...) ...@@ -439,6 +443,14 @@ asmlinkage int printk(const char *fmt, ...)
log_level_unknown = 1; 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)) { if (!down_trylock(&console_sem)) {
/* /*
* We own the drivers. We can drop the spinlock and let * We own the drivers. We can drop the spinlock and let
...@@ -455,6 +467,7 @@ asmlinkage int printk(const char *fmt, ...) ...@@ -455,6 +467,7 @@ asmlinkage int printk(const char *fmt, ...)
*/ */
spin_unlock_irqrestore(&logbuf_lock, flags); spin_unlock_irqrestore(&logbuf_lock, flags);
} }
out:
return printed_len; return printed_len;
} }
EXPORT_SYMBOL(printk); EXPORT_SYMBOL(printk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment