Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754443Ab0H3BOr (ORCPT ); Sun, 29 Aug 2010 21:14:47 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]:17402 "EHLO rcsinet10.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754381Ab0H3BOk (ORCPT ); Sun, 29 Aug 2010 21:14:40 -0400 Message-ID: <4C7B05A6.4010801@kernel.org> Date: Sun, 29 Aug 2010 18:13:10 -0700 From: Yinghai Lu User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100714 SUSE/3.0.6 Thunderbird/3.0.6 MIME-Version: 1.0 To: "H. Peter Anvin" , Ingo Molnar , Thomas Gleixner CC: Torsten Kaiser , Linus Torvalds , Linux Kernel Mailing List , Andrew Morton Subject: [PATCH] x86, setup: fix earlyprintk=serial,0x3f8,115200 References: <4C7B0578.8090807@kernel.org> In-Reply-To: <4C7B0578.8090807@kernel.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1327 Lines: 42 earlyprintk could take io port. So we need to handle this case in setup code too, otherwise 0x3f8 will be treated as baud rate. Signed-off-by: Yinghai Lu --- arch/x86/boot/early_serial_console.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) Index: linux-2.6/arch/x86/boot/early_serial_console.c =================================================================== --- linux-2.6.orig/arch/x86/boot/early_serial_console.c +++ linux-2.6/arch/x86/boot/early_serial_console.c @@ -58,7 +58,19 @@ static void parse_earlyprintk(void) if (arg[pos] == ',') pos++; - if (!strncmp(arg + pos, "ttyS", 4)) { + /* + * make sure we have + * "serial,0x3f8,115200" + * "serial,ttyS0,115200" + * "ttyS0,115200" + */ + if (pos == 7 && !strncmp(arg + pos, "0x", 2)) { + port = simple_strtoull(arg + pos, &e, 16); + if (port == 0 || arg + pos == e) + port = DEFAULT_SERIAL_PORT; + else + pos = e - arg; + } else if (!strncmp(arg + pos, "ttyS", 4)) { static const int bases[] = { 0x3f8, 0x2f8 }; int idx = 0; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/