Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751898AbdIEOyI (ORCPT ); Tue, 5 Sep 2017 10:54:08 -0400 Received: from mx2.suse.de ([195.135.220.15]:59678 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751345AbdIEOyH (ORCPT ); Tue, 5 Sep 2017 10:54:07 -0400 Date: Tue, 5 Sep 2017 16:54:05 +0200 From: Petr Mladek To: Eugeniy Paltsev Cc: Sergey Senozhatsky , Steven Rostedt , Hans de Goede , linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] console: don't select first registered console if stdout-path used Message-ID: <20170905145405.GH8741@pathway.suse.cz> References: <20170828165807.8408-1-Eugeniy.Paltsev@synopsys.com> <20170828165807.8408-3-Eugeniy.Paltsev@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170828165807.8408-3-Eugeniy.Paltsev@synopsys.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2353 Lines: 56 On Mon 2017-08-28 19:58:07, Eugeniy Paltsev wrote: > In the current implementation we take the first console that > registers if we didn't select one. > > But if we specify console via "stdout-path" property in device tree > we don't want first console that registers here to be selected. > Otherwise we may choose wrong console - for example if some console > is registered earlier than console is pointed in "stdout-path" > property because console pointed in "stdout-path" property can be add as > preferred quite late - when it's driver is probed. register_console() is really twisted function. I would like to better understand your problems before we add yet another twist there. Could you please be more specific about your problems? What was the output of "cat /proc/consoles" before and after the fix? What exactly started and stopped working? > We retain previous behavior for tty0 console (if "stdout-path" used) > as a special case: > tty0 will be registered even if it was specified neither > in "bootargs" nor in "stdout-path". > We had to retain this behavior because a lot of ARM boards (and some > powerpc) rely on it. My main concern is the exception for "tty". Yes, it was regiression reported in the commit c6c7d83b9c9e6a8b3e ("Revert "console: don't prefer first registered if DT specifies stdout-path""). But is this the only possible regression? All this is about the fallback code that tries to enable all consoles until a real one with tty binding (newcon->device) is enabled. v1 version of you patch disabled this fallback code when a console was defined by stdout-path in the device tree. This emulates defining the console by console= parameter on the command line. It might make sense until some complains that a console is not longer automatically enabled while it was before. But wait. Someone already complained about "tty0". We can solve this by adding an exception for "tty0". And if anyone else complains about another console, we might need more exceptions. We might endup with so many exceptions that the fallback code will be always used. But then we are back in the square and have the original behavior before your patch. This is why I would like to know more info about your problem. We need to decide if it is more important than a regression. Or if it can be fixed another way. Best Regards, Petr