From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 143DA18DF80 for ; Fri, 6 Feb 2026 16:50:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770396608; cv=none; b=tEbzNHN0t1Hq1AjtELJbve5lGVwXsnkXIMdtEzg8IAWkDD65Er0/M7i5XJMaMWDDDWis8kEywWSAvVci1c/HoGBa3SzSnZDqQOUpLbPCe6WmJV9gmVUeEdZHLR8J72DTSns79gCXNQZcusdx76jgCOYx9b4Raaxz6SExUbrATsA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770396608; c=relaxed/simple; bh=V9brv/iITJ7BATpZdGJH7Z2ukWE1P59bcSXEj/DTlA0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=NwCqj1Otjg7mHUWhM/lw1JgREEGBoIufDu7n9nLMDaRAdOMjJXpmMuGCiAYJxn0Ex9k0slofQQia5MNvVTlbxWRcvViqTDFdj+KKjdHWZIMBmPUxjttbzm235TMEElEfHaoI7XaIZHRe4NhitB8v39m/XjIqgXRooefNBMneNlo= 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 (1024-bit key) header.d=suse.com header.i=@suse.com header.b=WAD/AZ9E; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=H51MVzvu; arc=none smtp.client-ip=195.135.223.130 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 (1024-bit key) header.d=suse.com header.i=@suse.com header.b="WAD/AZ9E"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="H51MVzvu" Received: from pathway.suse.cz (unknown [IPv6:2a07:de40:b2bf:1b::12bd]) by smtp-out1.suse.de (Postfix) with ESMTP id 30E843E6D4; Fri, 6 Feb 2026 16:50:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1770396606; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l09WlF2sCXsxCVcMOKsbsT2+MydWYrQexvmnWEfrohI=; b=WAD/AZ9ElAF1rqzFAx2sHBKM6Ijc607IP8u/3WKEO/QCpkuIbntZVC4YzSDj5aa8V2JfOQ 3bxgMEipKiQdBglpktSDAOxZRkbdTXNEQ8F9rhzehhij5kAHlPYb4dNcC6ixvuHLSN8Ghh Qf3Pv+Bky5BowhFL8aCYWJDPWo6Bn/4= Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=H51MVzvu DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1770396604; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l09WlF2sCXsxCVcMOKsbsT2+MydWYrQexvmnWEfrohI=; b=H51MVzvuAfWAALKfbNdr0iw9nqNcuYKpI3R8Fr+1aDlfo4D54dWBeRGZ3+rTRQeE6qnADP 4zWpf9+46TFvXEcr9qw7e2egwkWc+OelIg7SSmfmiBPVSwOUrt1E2UW8VjDaGDCBgttQIL oKK6ipYAdSd4L0ZBc+/hfKyaDpObQjE= From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , Steven Rostedt , Marcos Paulo de Souza , Chris Down , linux-kernel@vger.kernel.org, Petr Mladek Subject: [PATCH 0/8] printk: Clean up preferred console handling Date: Fri, 6 Feb 2026 17:49:54 +0100 Message-ID: <20260206165002.496724-1-pmladek@suse.com> X-Mailer: git-send-email 2.52.0 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=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 16.17 X-Spamd-Result: default: False [16.17 / 50.00]; SPAM_FLAG(5.00)[]; NEURAL_SPAM_LONG(3.50)[1.000]; BAYES_HAM(-3.00)[99.99%]; NEURAL_SPAM_SHORT(2.98)[0.992]; HFILTER_HOSTNAME_UNKNOWN(2.50)[]; RDNS_NONE(2.00)[]; ONCE_RECEIVED(1.20)[]; MID_CONTAINS_FROM(1.00)[]; HFILTER_HELO_IP_A(1.00)[pathway.suse.cz]; HFILTER_HELO_NORES_A_OR_MX(0.30)[pathway.suse.cz]; R_DKIM_ALLOW(-0.20)[suse.com:s=susede1]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b2bf:1b::12bd:from]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; DIRECT_TO_MX(0.00)[git-send-email 2.52.0]; RCVD_COUNT_ZERO(0.00)[0]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[suse.com:+]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b2bf:1b::12bd:from]; RCPT_COUNT_SEVEN(0.00)[7]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:mid,pathway.suse.cz:helo] X-Rspamd-Action: add header X-Rspamd-Queue-Id: 30E843E6D4 X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Level: **************** X-Spamd-Bar: ++++++++++++++++ X-Spam-Flag: YES X-Spam: Yes Hi, this patches does some clean up of the code for handling preferred consoles in the console registration code. + 1st and 2nd patch try to improve a naming. The meaning of struct console_cmdline has changed over time. The meaning of "preferred_console" variable has always been a bit confusing and it has got even worse after adding the support for Braille consoles. + 3rd patch remove some code duplication. It better defines and describes the rules for adding and updating preferred consoles. It uses a more defensive coding style. + 4th, 5th, and 6th patch improve handling of Braille consoles. They are preferred via the command line but they do not get printk() messages and are not associated with /dev/console. The new code makes this more obvious. Also it explicitly defines the relation against default consoles and other non-Braille preferred consoles. + 7th patch removes a hidden side effect of try_enable_preferred_console() + 8th patch removes the last hidden side effect of try_enable_preferred_console() and allows to call it only when there are any non-Braille preferred consoles. I tested many scenarios of fixed several bugs. I did my best to prevent regressions. This patchset is a prerequisite for Marcos' clean up of CON_ENABLE flag handling. It should prevent regressions caused by the hidden effects of try_enable_preferred_console(), for example, see https://lore.kernel.org/r/89409a0f48e6998ff6dd2245691b9954f0e1e435.camel@suse.com Also I am working on a feature which would allow to explicitly enable/prefer consoles proposed by SPCR, device tree, or platform-specific code using a generic "console=platform". This clean up is a prerequisite, see https://github.com/pmladek/linux/tree/console-platform-poc1-iter9 The patchset has been re-based on top of v6.19-rc8. Petr Mladek (8): printk: Rename struct console_cmdline to preferred_console printk: Rename preferred_console to preferred_dev_console printk: Separate code for adding/updating preferred console metadata printk: Cleanup _braille_(un)register_console() wrappers printk: Try to register each console as Braille first printk: Do not set Braille console as preferred_console printk: Handle pre-enabled consoles directly in register_console() printk: Try enable preferred consoles only when there are any .../accessibility/braille/braille_console.c | 7 +- kernel/printk/braille.c | 20 +- kernel/printk/braille.h | 23 +- .../{console_cmdline.h => console_register.h} | 6 +- kernel/printk/printk.c | 295 ++++++++++++------ 5 files changed, 223 insertions(+), 128 deletions(-) rename kernel/printk/{console_cmdline.h => console_register.h} (83%) -- 2.52.0