From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EACEC33FE06 for ; Thu, 19 Feb 2026 14:55:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771512932; cv=none; b=JnkKawHzQXPp7AE0SwURXUi/Mu61nOcgYpXPNvyoMzUBCtPNCJbkbqwmSfLlx0Z8XgyUCL02uifyi+zegUmqEsTYuX8D8hR0U7HjfO5SkcCd8FQgIFe+8x3gGvDbby4cU5kZb+l0oPHHJe+XCOmCQEl97yEnVaBUsoPHiLarT9k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771512932; c=relaxed/simple; bh=9A/OI55oMLD1VhWOrSHeU9WTINvXUqpV+AR7CbRxfLQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ssdhza0C2iwV0mpGTxdpYps4hbd+M7gI5WEqhH/4RA8KUId8On1XU0CyPzVQlpaOy6zTtswPSvzI0bEEiVbV1hs3EyUuJvvMzKIigx1LFT7YGmC+WN/29DL+u6Wly8S7zu2h68fPbMfDdjIRHItPaJDo8T0zm3+S614D3rzD7fU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=B0wMeYEA; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="B0wMeYEA" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-48371bb515eso14151625e9.1 for ; Thu, 19 Feb 2026 06:55:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1771512929; x=1772117729; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=E6SRlp93WRjppdOP+WHzFRnndhcI2u0VfRNzSWpjbPY=; b=B0wMeYEAmVfkpoMyQFAhsarS/mM27IXp1fLql6l0dwxpgkETfuW4tzD3RT5CbgYGLd ogSQtrgtxk4s/ztkNFktYL0uzDfcSv+lVC7m6Gn37EYfkF0fxcZKhWitLzk/e6yyio3B 9NFEscI2PijjvRYui9atKyjwA6f8RJWCJ8ksxRPOej1moFKYDUWUcKlGJIzWfhTA491E 9TveJEbk1Sy39pfLOpi4qX4njqB+yXMsYGX/x2xT7oJQZnSgw6tng37aN/RkYGO0rK8z PyaY6qP5KbSvBGKvVJjWKefUKF3/ILyveOLlQUQ/41KHnWUrh7a8hSuLiW+ftsT/ZCjS ZhrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771512929; x=1772117729; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E6SRlp93WRjppdOP+WHzFRnndhcI2u0VfRNzSWpjbPY=; b=tVM86z17PIQmW9gcxkZxR6xMG8G3kyB4LP2nPD/U+uPJKCXRugnpZNKcS0h1ocPjV4 9SZKoHG0rRwIRMFoyCBzJhnqbXQnFdOYSZXXlejvFccpPmv8haQRSI2jQi15SYrANuSH 2hGQHLCZ69D8ZyAIkHNfD69R3qMzOAwR5sc1DYbQTmHR9RyvgK0SCeyQdzlJI8yf+yM3 +SivDBJu2ELDXZW4WULjIfmKYDj7zCl1eB4YpMIR0PA+pfjDiPbb7pYLHBy6pKB8Abvp f4Tf7+slfhzot9g1WnW42b2GY/512k4dXwutTOdVjOhTjzAJXQBl8X0AETDRH9TsWms3 NUVA== X-Forwarded-Encrypted: i=1; AJvYcCViI5fWZ9xjGriqAemr+lmcHVMRjEvT6i7bV9E0fWDvPzf8JkOudzG+xaxgMl4dMfd/nHSnRFQy4YvOjV0=@vger.kernel.org X-Gm-Message-State: AOJu0Yy3M6qjKpKDPlJLLeoIMLjkwKQPsFDuB43LHywvcrBxz8tR3Hra ieXWcaQcTbMI9txp/NLrs6HbPMQsFBG74zOlS/wGipjV99VPJrDa5gp2GM8xzqMB54tGU+UptCl 8nrGR X-Gm-Gg: AZuq6aJNAyy4t98IJn67gAlJqQ0cqtpEAoGMJLzkS4ht7prqVeLTbamGluNaMxrHaJb LdCF6L3Q+uWVedD+79+AwzRKa6lbu0MRMC5urV+vCTnuRFMFBsSZSgEbFPCHbKnb8QqXifUijbt ASa6MVIpfaBOGSMwBl99IJnXfPtVWF1JtPqO7rASHaiGtaT9qoMtccqkR9QK1LzaIEhEJlgmAGr +1bWPfJdZTxwrrqg2tUEfrjGF6EVSJ7383sM4xa3wZMIgAsU9RDqlmXqToHUbs8Iz+NU44ivECO GaNNNJT/dLrmwVmsSixT9sUwTcdk9CKJm/PF3KjsJGNh3u/9KwEdu87ZcQhvp4DVQfzmZNc389b O8UZPfLzRUT+38NCs/M/8P6tb5ex2JzHcyKfTE5mWUOh0iLzMTAI2tiCVU6CIbYC6MtE8981m6N 9ichjJ64BrC4o0rGsSYEsVFb3+lg== X-Received: by 2002:a05:600c:3110:b0:480:f27c:6335 with SMTP id 5b1f17b1804b1-48398b6dba0mr94221375e9.25.1771512929112; Thu, 19 Feb 2026 06:55:29 -0800 (PST) Received: from pathway.suse.cz ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483a31bfbd0sm7613005e9.6.2026.02.19.06.55.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Feb 2026 06:55:28 -0800 (PST) Date: Thu, 19 Feb 2026 15:55:27 +0100 From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , Steven Rostedt , Marcos Paulo de Souza , Chris Down , linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/8] printk: Do not set Braille console as preferred_console Message-ID: References: <20260206165002.496724-1-pmladek@suse.com> <20260206165002.496724-7-pmladek@suse.com> <87qzqkd64x.fsf@jogness.linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87qzqkd64x.fsf@jogness.linutronix.de> On Mon 2026-02-16 17:13:10, John Ogness wrote: > On 2026-02-06, Petr Mladek wrote: > > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > > index 279b36ef90bd..eb224eaace64 100644 > > --- a/kernel/printk/printk.c > > +++ b/kernel/printk/printk.c > > @@ -365,6 +365,7 @@ static int console_locked; > > static struct preferred_console preferred_consoles[MAX_PREFERRED_CONSOLES]; > > > > static int preferred_dev_console = -1; > > +static int preferred_dev_console_prev = -1; > > static bool want_braille_console; > > int console_set_on_cmdline; > > EXPORT_SYMBOL(console_set_on_cmdline); > > @@ -2555,10 +2556,23 @@ static int update_preferred_console(int i, const char *name, const short idx, > > > > braille_update_options(pc, brl_options); > > > > - if (brl_options) > > + if (brl_options) { > > want_braille_console = true; > > - else > > + /* > > + * This console name will always get enabled as Braille > > + * console. It takes special code paths in register_console(). > > + * Do not treat it as a normal preferred_console. > > + */ > > + if (preferred_dev_console == i) > > + preferred_dev_console = preferred_dev_console_prev; > > I am wondering if in this case it should also do: > > preferred_dev_console_prev = -1; > > to make sure that @preferred_dev_console never ends up at a Braille > device. Great catch! > > + } else { > > + /* > > + * Only the VisioBraille device is supported at the moment. > > + * One level history should be enough. > > + */ > > + preferred_dev_console_prev = preferred_dev_console; > > preferred_dev_console = i; > > + } We actually also need to prevent setting "preferred_dev_console" when the same console has been preferred as Braille before, for example: console=brl,ttyS0,115200 console=ttyS0,115200 One might argue that the later definition should win. But it would be a regression. The motivation to keep the current behavior is that the Braille console is special. IMHO, it should always win. Otherwise, the user might have hard times to debug the problem. My new version of this code is: /* * The last preferred console should get associated with /dev/console. * Except for the Braille console which can't get associated with * /dev/console. One level history should be enough because only one, * the VisioBraille device, is supported at the moment. */ if (brl_options) { want_braille_console = true; if (preferred_dev_console == i) { preferred_dev_console = preferred_dev_console_prev; preferred_dev_console_prev = -1; } } else if (!is_braille_console_preferred(pc)) { preferred_dev_console_prev = preferred_dev_console; preferred_dev_console = i; } Best Regards, Petr