public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/earlyprintk: setup earlyprintk as early as possible
@ 2015-04-06 13:17 Alexander Kuleshov
  2015-04-07  9:52 ` Ingo Molnar
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Kuleshov @ 2015-04-06 13:17 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Greg Kroah-Hartman
  Cc: linux-kernel, Alexander Kuleshov

As setup_earlyprintk passed to the early_param, it will be usable only after
'parse_early_param' function will be called from the 'setup_arch'. So we have
earlyprintk during early boot and decompression. Next point after decompression
of the kernel where we can use early_printk is after call of the
'parse_early_param'.

This patch removes 'earlyprintk' from the early_param and setup it right after
boot data copying. So 'early_printk' function will be usabable after
decompression of kernel and before parse_early_param will be called.

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 arch/x86/kernel/early_printk.c | 4 +---
 arch/x86/kernel/head64.c       | 1 +
 include/linux/printk.h         | 1 +
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index a62536a..4b0577b 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -329,7 +329,7 @@ static inline void early_console_register(struct console *con, int keep_early)
 	register_console(early_console);
 }
 
-static int __init setup_early_printk(char *buf)
+int __init setup_early_printk(char *buf)
 {
 	int keep;
 
@@ -390,5 +390,3 @@ static int __init setup_early_printk(char *buf)
 	}
 	return 0;
 }
-
-early_param("earlyprintk", setup_early_printk);
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index c4f8d46..0141de7 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -171,6 +171,7 @@ asmlinkage __visible void __init x86_64_start_kernel(char * real_mode_data)
 	load_idt((const struct desc_ptr *)&idt_descr);
 
 	copy_bootdata(__va(real_mode_data));
+	setup_early_printk(boot_command_line);
 
 	/*
 	 * Load microcode early on BSP.
diff --git a/include/linux/printk.h b/include/linux/printk.h
index baa3f97..47e3919 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -115,6 +115,7 @@ int no_printk(const char *fmt, ...)
 #ifdef CONFIG_EARLY_PRINTK
 extern asmlinkage __printf(1, 2)
 void early_printk(const char *fmt, ...);
+int setup_early_printk(char *buf);
 #else
 static inline __printf(1, 2) __cold
 void early_printk(const char *s, ...) { }
-- 
2.3.3.611.g09038fc.dirty


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-04-07 19:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-06 13:17 [PATCH] x86/earlyprintk: setup earlyprintk as early as possible Alexander Kuleshov
2015-04-07  9:52 ` Ingo Molnar
2015-04-07 10:19   ` Alexander Kuleshov
2015-04-07 10:24     ` Ingo Molnar
2015-04-07 10:31       ` Alexander Kuleshov
2015-04-07 10:33         ` Ingo Molnar
2015-04-07 19:07         ` Yinghai Lu
2015-04-07 19:08           ` Yinghai Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox