From patchwork Sun Sep 1 16:24:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Hutchings X-Patchwork-Id: 271616 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id C4A982C0106 for ; Mon, 2 Sep 2013 02:25:00 +1000 (EST) Received: from shadbolt.e.decadent.org.uk (shadbolt.e.decadent.org.uk [88.96.1.126]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A27032C0097 for ; Mon, 2 Sep 2013 02:24:30 +1000 (EST) Received: from deadeye.wl.decadent.org.uk ([192.168.4.101]) by shadbolt.decadent.org.uk with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1VGARr-0001Ky-26; Sun, 01 Sep 2013 17:24:23 +0100 Received: from ben by deadeye.wl.decadent.org.uk with local (Exim 4.80) (envelope-from ) id 1VGARq-00008R-AC; Sun, 01 Sep 2013 17:24:22 +0100 Message-ID: <1378052656.25743.33.camel@deadeye.wl.decadent.org.uk> Subject: [PATCH] hvc_vio: Do not override preferred console set by kernel parameter From: Ben Hutchings To: Jiri Slaby , Greg Kroah-Hartman Date: Sun, 01 Sep 2013 17:24:16 +0100 X-Mailer: Evolution 3.4.4-3 Mime-Version: 1.0 X-SA-Exim-Connect-IP: 192.168.4.101 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Cc: Bastian Blank , linuxppc-dev@lists.ozlabs.org, Debian kernel maintainers X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16rc2 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The original version of this was done by Bastian Blank, who wrote: > The problem is the following: > - Architecture specific code sets preferred console to something bogus. > - Command line handling tries to set preferred console but is overruled > by the old setting. > > The udbg0 console is a boot console and independant. References: http://bugs.debian.org/492703 Signed-off-by: Ben Hutchings --- We've been carrying this in Debian for 5 years now, so it's about time it got reviewed. I'm not convinced strstr() is the right way to check the command line (what if there's also a 'netconsole='?). Ben. --- a/drivers/tty/hvc/hvc_vio.c +++ b/drivers/tty/hvc/hvc_vio.c @@ -48,6 +48,7 @@ #include #include #include +#include #include "hvc_console.h" @@ -440,7 +441,9 @@ if (hvterm_priv0.proto == HV_PROTOCOL_HVSI) goto out; #endif - add_preferred_console("hvc", 0, NULL); + /* Check whether the user has requested a different console. */ + if (!strstr(cmd_line, "console=")) + add_preferred_console("hvc", 0, NULL); hvc_instantiate(0, 0, ops); out: of_node_put(stdout_node);