mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Kuleshov <kuleshovmail@gmail.com>
To: "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Kees Cook <keescook@chromium.org>,
	Vivek Goyal <vgoyal@redhat.com>
Cc: linux-kernel@vger.kernel.org, Andi Kleen <ak@linux.intel.com>,
	Alexander Kuleshov <kuleshovmail@gmail.com>
Subject: [PATCH] [Bugfix] x86/boot/compressed: Fix serial I/O during compressed boot
Date: Sun,  8 Feb 2015 18:33:32 +0600	[thread overview]
Message-ID: <1423398812-779-1-git-send-email-kuleshovmail@gmail.com> (raw)

Previously it used early_serial_base from the
arch/x86/boot/compressed/early_serial_console.c, and it's zero everytime,
so serial I/O didn't work/print anything in the kernel decompressing code.

Let's define early_serial_base in the arch/x86/boot/early_serial_console.c
and make it extern, so code from boot/compressed directory can use it.

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 arch/x86/boot/compressed/early_serial_console.c | 2 --
 arch/x86/boot/compressed/misc.c                 | 3 ++-
 arch/x86/boot/early_serial_console.c            | 2 ++
 arch/x86/boot/tty.c                             | 2 --
 4 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/x86/boot/compressed/early_serial_console.c b/arch/x86/boot/compressed/early_serial_console.c
index 261e81f..c80d915 100644
--- a/arch/x86/boot/compressed/early_serial_console.c
+++ b/arch/x86/boot/compressed/early_serial_console.c
@@ -1,5 +1,3 @@
 #include "misc.h"
 
-int early_serial_base;
-
 #include "../early_serial_console.c"
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index a950864..2bde4db 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -390,7 +390,8 @@ asmlinkage __visible void *decompress_kernel(void *rmode, memptr heap,
 	lines = real_mode->screen_info.orig_video_lines;
 	cols = real_mode->screen_info.orig_video_cols;
 
-	console_init();
	/* 
	 * serial i/o can be already initialized if we runned in 16-bit 
	 * real mode and didn't use 32/64-bit boot protocol.
	 */
+	if (!early_serial_base)
+		console_init();
 	debug_putstr("early console in decompress_kernel\n");
 
 	free_mem_ptr     = heap;	/* Heap */
diff --git a/arch/x86/boot/early_serial_console.c b/arch/x86/boot/early_serial_console.c
index 5df2869..af32b39 100644
--- a/arch/x86/boot/early_serial_console.c
+++ b/arch/x86/boot/early_serial_console.c
@@ -1,5 +1,7 @@
 #include "boot.h"
 
+int early_serial_base;
+
 #define DEFAULT_SERIAL_PORT 0x3f8 /* ttyS0 */
 
 #define XMTRDY          0x20
diff --git a/arch/x86/boot/tty.c b/arch/x86/boot/tty.c
index def2451..0cb0b4c 100644
--- a/arch/x86/boot/tty.c
+++ b/arch/x86/boot/tty.c
@@ -15,8 +15,6 @@
 
 #include "boot.h"
 
-int early_serial_base;
-
 #define XMTRDY          0x20
 
 #define TXR             0       /*  Transmit register (WRITE) */
-- 
2.3.0


             reply	other threads:[~2015-02-08 12:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-08 12:33 Alexander Kuleshov [this message]
2015-02-08 13:39 ` Alexander Kuleshov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1423398812-779-1-git-send-email-kuleshovmail@gmail.com \
    --to=kuleshovmail@gmail.com \
    --cc=ak@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=vgoyal@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®