Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752132AbbEHGei (ORCPT ); Fri, 8 May 2015 02:34:38 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:59382 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751238AbbEHGeh (ORCPT ); Fri, 8 May 2015 02:34:37 -0400 Date: Fri, 8 May 2015 08:34:33 +0200 From: Sascha Hauer To: Peter Hurley Cc: "Maciej W. Rozycki" , kernel@pengutronix.de, Robert Schwebel , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: Re: earlycon: no match? Message-ID: <20150508063433.GA6325@pengutronix.de> References: <20150503211054.GR15254@pengutronix.de> <55477BC1.6000805@hurleysoftware.com> <20150504194229.GR15254@pengutronix.de> <5547D4DB.8060300@hurleysoftware.com> <20150504205241.GT15254@pengutronix.de> <5547E447.9020604@hurleysoftware.com> <554B9F43.6000702@hurleysoftware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <554B9F43.6000702@hurleysoftware.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 08:31:34 up 52 days, 18:23, 83 users, load average: 0.32, 0.12, 0.08 User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3711 Lines: 98 On Thu, May 07, 2015 at 01:22:11PM -0400, Peter Hurley wrote: > On 05/07/2015 01:09 PM, Maciej W. Rozycki wrote: > > On Mon, 4 May 2015, Peter Hurley wrote: > > > >>>> Since 2007, 'console=' is a early param synonym for 'earlycon='; IOW, > >>>> the message is new but not the behavior. > >>> > >>> "console=" had nothing to do with early param before. > >> > >> *Yes, it has* since the commit I referenced in the previous email and > >> the email before that when I noted that 'console=' and 'earlycon=' are > >> synonyms if CONFIG_SERIAL_EARLYCON=y, and it has been that way since > >> 2007. > >> > >> The only thing that has changed is that I added a diagnostic; _to repeat_, > >> the earlycon matching code has always run in this case, only the > >> diagnostic is new. > > > > What's the point of having two parameters as synonyms whose syntax is not > > compatible to each other in the general case? I'd expect the following > > cases to be handled: > > > > 1. Regular console only (no early console requested) => `console=foo...'. > > > > 2. Both early and regular console => `earlycon=blah... console=foo...'. > > > > 3. Early console handing over to regular console => `earlycon=blah...'. > > 4. Early console only => `earlycon=blah...' > > How to distinguish between 3 & 4? Given that the aliasing only makes sense for console=uart, and console=uart8250, we can do the following. Not exactly the nicest code, but only slighty more ugly than what we have now in do_early_param() Sascha --------------------------8<---------------------------- >From e4d5a09877e48308ee0cf4170f2eef8aa2f747f5 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 8 May 2015 08:23:47 +0200 Subject: [PATCH] param: console: Do not treat console as synonym for earlycon Since 2007 console= and earlycon= are treated as synonyms, but the syntax for both options is different. The only case in which they are identical is for console=uart or console=uart8250. All other cases currently lead to the warning: earlycon: no match for xxx This patch drops the general aliasing, but keeps the current behaviour for console=uart and console=uart8250 to keep the kernel parameters compatible. Signed-off-by: Sascha Hauer --- init/main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/init/main.c b/init/main.c index 2115055..bfcbbc5 100644 --- a/init/main.c +++ b/init/main.c @@ -413,12 +413,15 @@ static noinline void __init_refok rest_init(void) static int __init do_early_param(char *param, char *val, const char *unused) { const struct obs_kernel_param *p; + bool earlyconalias = false; + + if (val && !strcmp(param, "console") && + (!strncmp(val, "uart,", 5) || !strncmp(val, "uart8250,", 9))) + earlyconalias = true; for (p = __setup_start; p < __setup_end; p++) { if ((p->early && parameq(param, p->str)) || - (strcmp(param, "console") == 0 && - strcmp(p->str, "earlycon") == 0) - ) { + (earlyconalias && strcmp(p->str, "earlycon") == 0)) { if (p->setup_func(val) != 0) pr_warn("Malformed early option '%s'\n", param); } -- 2.1.4 -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- 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/