From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 1F75BF507 for ; Thu, 19 Feb 2026 16:59:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771520357; cv=none; b=f/tvjmhIXuIwvJsWWnlkrk4qdeyv70Gm+GEP4qlfKBcatzdmQ4M8y8QqyqyPbF+xxhWPxwNUQHStoGP5+kgro5paG443Ksjb5y4XEHkvG3G+9pp+1dpuu+HM27eoBFVzlCRseEIhIa5xrqq9qVGiY1ekxcvob9Kyzkez7l5lJ9Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771520357; c=relaxed/simple; bh=ykVu6sl3aXj9CuTty+d9/Ut/5JhdSODTVhup8zKoFP0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nvH42UuWLdTUIDpaYbVU39rPPnYdC++Jn5b4mt6/d/9DBHA5X0Z4R0qzF5raicBgN5EFVgn233/hOzkuZvNGmz+f+oLdwO0ZiaoCkcG58e3VnLCoiNBz3GfQPVPIXEpoHwPy0cr8x10TGAQhBXcMMaE8Dy2tEJbPNS+5pH22c9c= 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=Q3zScs++; arc=none smtp.client-ip=209.85.128.47 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="Q3zScs++" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4837f27cf2dso10423575e9.2 for ; Thu, 19 Feb 2026 08:59:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1771520354; x=1772125154; 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=aUds3GM2dMjPWo8nMjOS9AaKv7vDCvu3AT4rDyyIkvA=; b=Q3zScs++4acacn4pkV5UDveznaFiYSm43wegOGZM2mAw+/Fx9SrDecNY2xKkte059M v4j2WTbJRc7XywmCAaaSI0J2MUFBmgv98VDnh5evfzexAyh3IJbT9jz8+ZGAOcP0GQw0 0w1nawTnxY2yT+ZjazTozVRx7ojP+Lfy81q1FmSB7pnvTh0Lhak76j4QJb4SmL4GIQtb g5oJlRrDyEWUhTbxoPhcUZouOHJcch4kdHO0iYip+l3L+2KJKjXXF6CXTWBAxu2D3WUW 5cGfJXzo9iuo6j8hM2on5Ln6u1Pfh1ZDcpFrWVhjvl54z6aSHtRuINR/P/RvQ/RvKoU9 qZiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771520354; x=1772125154; 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=aUds3GM2dMjPWo8nMjOS9AaKv7vDCvu3AT4rDyyIkvA=; b=oKz0uDeaR8hu84+fPyBr9D2ZlkSjl7j4py4jVD2uVTLEZsr0bG1CDAJ3TZ/0QVufHj EsGBJOBtWgCpjd4zuJ5BriZ+5jQR5Qa92TdbXiW200ygIbbokZcA6aY2M/fJ6yI0u+gr 4xk+Z/VjaGdmIDQBNWuIlzIXg5dfmL80nAjrEdGLzs01wHUycZKzs9QB09eDvtyEkZy4 hrwepHzKmj/IP5Qg6e1F6skwaXazBHSS7iSfmjxTx8ey6DfAUMABS/P/dAgx40iOMyQD Ao4hhrN63aV7xcN0gSbX6WLWY3mSl3F6QVRlaNMa0iuZzBkA2ZB1vuiduFnpnqVBe9li e/Eg== X-Forwarded-Encrypted: i=1; AJvYcCVxDKQJu1QNfodR+QbRn62gRfzD2ZpztnhXoBI5ynKYThfgtOiIxGAQ6HCXl/0LkOfeLpaLC58n311YcMc=@vger.kernel.org X-Gm-Message-State: AOJu0YwZhpG+gLwbJdb8Ir8aykFnqyV66fg7dE3X80jSxUItxQ6/zpr0 TSWOSatUFLsN+NcdNfksknzenYnuXce33gub3aW6IL2F4m3mebnurgcoK/tUOVUnB1w= X-Gm-Gg: AZuq6aKe87G0yODvwTpbbhJCWqiMG8YhPkor+lsBQZr40A4g3aZ2qKke5ikN7rKBctu TQpeyrQzXNCwgzn46nnQbeWUgu7MDWeXlVYV+qrhLAvKmUkigVfIhFjZX5UC33QWcIQ2Lw/YYxb Cj+LhVc5PT6Gb4usTP1VgDO/erCMIbXfziB4DtHbsBxeGbr+APMtT6ISUNPDi8suHyfmxTzqF+g DU7q5czjp8cLGqUOs4qFH2hpR+4Cwb+94K50ptoaWagx1NMlDllndnhKua6Y6y/zczkAAWuEvKi AcUHYvWgnyDnzvzc/1kpCxz4pD6nzCAM5pa9lMjj6FOHllHK0xu2p3xYgfqhfp6mISVHfJEHfn0 ra7atl+txyxMXcZUu5QXjMO2XBluuYrYTn06GA9Zb1nP5Xx6ticWrMGs9S3TCrpEsUKcjoiN9/e rYpImGAhLpINHAAd4DDesgMgRIp9DkfrbMXpc4 X-Received: by 2002:a05:600c:1547:b0:477:afc5:fb02 with SMTP id 5b1f17b1804b1-483710858c8mr387050175e9.21.1771520354178; Thu, 19 Feb 2026 08:59:14 -0800 (PST) Received: from pathway.suse.cz ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483a31efe02sm14021215e9.10.2026.02.19.08.59.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Feb 2026 08:59:13 -0800 (PST) Date: Thu, 19 Feb 2026 17:59:11 +0100 From: Petr Mladek To: Chris Down Cc: John Ogness , Sergey Senozhatsky , Steven Rostedt , Marcos Paulo de Souza , linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/8] printk: Try to register each console as Braille first Message-ID: References: <20260206165002.496724-1-pmladek@suse.com> <20260206165002.496724-6-pmladek@suse.com> 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: On Thu 2026-02-19 22:59:38, Chris Down wrote: > Petr Mladek writes: > > @@ -3918,6 +3922,12 @@ static int try_enable_preferred_console(struct console *newcon, > > newcon->match(newcon, pc->name, pc->index, pc->options) != 0) { > > /* default matching */ > > BUILD_BUG_ON(sizeof(pc->name) != sizeof(newcon->name)); > > + /* > > + * Two entries might have the same pc->name when one was > > + * defined via "devname". > > + */ > > + if (try_only_braille && !is_braille_console_preferred(pc)) > > + continue; > > if (strcmp(pc->name, newcon->name) != 0) > > continue; > > if (newcon->index >= 0 && > > @@ -3926,7 +3936,7 @@ static int try_enable_preferred_console(struct console *newcon, > > if (newcon->index < 0) > > newcon->index = pc->index; > > > > - if (is_braille_console_preferred(pc)) > > + if (try_only_braille) > > return _braille_register_console(newcon, pc); > > > > err = console_call_setup(newcon, pc->options); > > This doesn't look right to me. By putting the Braille dispatch inside the if > block, you bypass it whenever newcon->match matches. > > So that means if a console driver matches, the execution skips this default > matching block completely, falls through, and silently sets CON_ENABLED > without ever registering it as a Braille console or adding it to > console_list, and the console is silently lost. > > The try_only_braille and is_braille_console_preferred(pc) checks likely need > to happen before or independently of the match() vs. default matching > branch. This should never happen because register_console() always tries to register Braille consoles first. This patch adds the following hunk into register_console(): @@ -4173,6 +4194,20 @@ void register_console(struct console *newcon) goto unlock; } + /* + * First, try to enable the console driver as a Braille console. + * It would have metadata in the preferred_consoles[] array. + * But it won't be counted as @preferred_console because + * it does not get printk() messages and is not associated + * with /dev/console. + */ + if (want_braille_console) { + err = try_enable_braille_console(newcon); + /* Return on success or when con->setup failed. */ + if (err != -ENOENT) + goto unlock_free; + } + /* * See if we want to enable this console driver by default. * I am going to add a comment into try_enable_preferred_console() about this. Best Regards, Petr