Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1724973ybl; Thu, 19 Dec 2019 01:51:56 -0800 (PST) X-Google-Smtp-Source: APXvYqwHAOF7wlJVaQJyTyf5cinL/MdOcmlbTPmfCBVnf9e9hoNssIAQnabqhd6ORQYYzqIe7eKk X-Received: by 2002:a05:6830:1715:: with SMTP id 21mr8098745otk.67.1576749116313; Thu, 19 Dec 2019 01:51:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576749116; cv=none; d=google.com; s=arc-20160816; b=D4qC7QAAmvk7Zc2O/E3BqzaK4CETszgKc/yr1Am0eqi/XqFmTA2K0g+2qakNduUUSS jwPbJPRqmu9O9ObaKmqCRi8qWi/qBQ4r5gqaHT5+DGwF6LF9+fCYQ8zd0DJh9snV9cUt qZ6MN+YZAYsFU0o/PajRxn0imU2i5F50rN67LtnSsZONSIxFgdT1DcHVjHYy/7dcC+FO scEzHyDnRTIPwEHYDUcq+FYYoFpkaagi337UjHvju1SQOqEGOa2eaq8+YoZxATMB1DVY 8666KPItjPMsD1cr0kimfw685VIovQGrYNqInDqc6H4bAJ5HB6PUurH1ySs8ZPU0g8Gh KEWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=vqoYBHDh3j7qxRDJssgLM2I7wn7TXk1dg2f+JU9BCSg=; b=cRE9S/AZwCUpv88ceIllvIhrlFPUtgYDx70RqaZmxrnMWqQ4TC99W5or60nre7Rdjr vHwZAqLUEh8qJcvK2LnmhjaD64Bzgk0G+GyoqJ6hnabzKDW9PHsidgh0d6OAEPgsjKDO 4Te8mAm+hM6ftcMGlb53W/TW3adQHgN0l0i2DohAd95tiQFRTRgNb47kvCnG7jYUvbP8 KUbXEYWwXf9vB80JzdX6JYwdaH4zbdc753lp4jTytVjNJTQIcJtC3rqQlUb3KWp+qVVu OPxPsaYwIR9OidTewNAGmGzpKL6uu4jcHrMEWH7hH7H1qE5ECYNqBUtkrVGFmDLjR2c+ WcMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18si2871716oij.133.2019.12.19.01.51.44; Thu, 19 Dec 2019 01:51:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726699AbfLSJun (ORCPT + 99 others); Thu, 19 Dec 2019 04:50:43 -0500 Received: from mx2.suse.de ([195.135.220.15]:45708 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726599AbfLSJum (ORCPT ); Thu, 19 Dec 2019 04:50:42 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D7831AF41; Thu, 19 Dec 2019 09:50:40 +0000 (UTC) Date: Thu, 19 Dec 2019 10:50:38 +0100 From: Petr Mladek To: Benjamin Herrenschmidt Cc: linux-kernel@vger.kernel.org, Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , AlekseyMakarov Subject: Re: [RFC/PATCH] printk: Fix preferred console selection with multiple matches Message-ID: <20191219095038.hplirl7sxlpreo4w@pathway.suse.cz> References: <20191210091502.qoq55fdjad6aixab@pathway.suse.cz> <50d2c44a15960760c6a9d24442a93fa4b31b7594.camel@kernel.crashing.org> <20191211091740.p6bgjy7sy75maenw@pathway.suse.cz> <0511b917d8ebcf594480349b79fcb9f14aa882f9.camel@kernel.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0511b917d8ebcf594480349b79fcb9f14aa882f9.camel@kernel.crashing.org> User-Agent: NeoMutt/20170912 (1.9.0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 2019-12-16 11:09:33, Benjamin Herrenschmidt wrote: > On Wed, 2019-12-11 at 10:17 +0100, Petr Mladek wrote: > > The reverse search of list of console does not work for ttySX > > consoles because the number is omitted when matching. And the messages > > will appear only on the first matched serial console. There is > > a paragraph about this in the commit message of my patch. > > About that specific issue... > > I see indeed that 8250_core.c registers a "generic" console with index > -1 which will match whetever we hit first in the array. > > This is actually wrong isn't it ? Without any change such as what we've > been proposing, it means that an arch doing add_preferred_console of > any ttyS* will override anything on the command line, and it also means > that a command line with multiple ttyS entries will stop at the first > one, not the last one. > > IE. In both case the code will select a console that isn't > preferred_console... or am I missing something subtle ? > > So yes, fixing that will "regress" in the sense that it will change the > behaviour, but to make it match what's documented... am I wrong ? > > The question then becomes what's the most broken ? Changing the > behaviour that might have become expected or leaving the (alledgedly) > broken behaviour in place ? I though the same. But then I found the following in Documentation/admin-guide/serial-console.rst "If no console device is specified, the first device found capable of acting as a system console will be used. At this time, the system first looks for a VGA card and then for a serial port. So if you don't have a VGA card in your system the first serial port will automatically become the console." In addition, there is the "documentation" how systemd handles serial console and login prompts, see http://0pointer.de/blog/projects/serial-console.html I agree that the current behavior is wrong. I really would like to change it. But the result would be that some users will not get login prompt after a kernel update. I am afraid that we are blocked by the "do not break userspace" rule. Best Regards, Petr