Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp120154lqs; Thu, 13 Jun 2024 05:52:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXzY/W7EFqekO8S23PzNuLKylDY7O34vs+BLSWXeXUiYPN7XBu/vOIVO494ZNRi6Vdw/JsOXKVOhyZZgIczK0e/Ip8nhwOrltod6xvgZw== X-Google-Smtp-Source: AGHT+IGGJfSIfdUHM9mnaivl2AktG+beasDlZtIf56NvPES4QXtAx1/cSWPNfwK3PHoe01Mik1gC X-Received: by 2002:a05:6a20:2626:b0:1b8:1be8:7ff5 with SMTP id adf61e73a8af0-1b8a9c56dbdmr2968370637.50.1718283120526; Thu, 13 Jun 2024 05:52:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718283120; cv=pass; d=google.com; s=arc-20160816; b=I5a5AvFq+9H7lD4CQebumkQCTxfyUbacfxBkkfCJORHYahRGlmi8qoBdafiDqFmsog eM7E5PNPciQ/CyO8swjYUTVTDGwtgI5UFslocDsEtoH0KeGFu8EwTkR1BacroPxkbVbT FHuj8Y+oOcmD6P79iQs0jYxFy/PIQ/GWKTE9bPZ1F+tTB5d81NdjTwghDW19oXTEL4VQ /pojQPjUQxmcbQBWO3tfqEmQYgvnhu3+nk74G4gq2n4/IjDWMwp8AsbEvlcl7nizu10z BqWIIOZ2TXgqcPZ3dtNTIV7Jt4fgh2qsJUEKNTfqkt6gAbSF8HNaKH+e2eqh2FPZ+Pfx I55w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=6wFtwStZMs5VdyGYTGSqNo33TqByKxkt76WYJ0iE8/s=; fh=JepfPYV5ahrOqXyJHFHw0qeEoYBYoZmhKvUA5Cel9H8=; b=u3mLpbfAv74T6es+as32KjweiktTaUN1JxtzUBOoJztThMFQpvkVDT+ai6g4kIfBBB OuGrdvcBm+aEaOwsfKgHor7xqTnBlg1c2geHED+nbVRQGGTsF/isP87acpkuFEJYnApL bNbHWSbC3KbK/fDviaTMvupyw9eIdD5o5EIvtJ6aVt70c+z3m4HvmiY3AM2HZJ/8651b 7gRha7gbH1CXiyu9WF8SdCr8NmBrPh4RoPZbgLJdU43OmiMaMYn/9l10yoW2C9OA9kkD jqkDRx/n2m3cLI4JrK3vGDMQruwlg13/kFn0qPutuWr1MWmywogpIYc+NWwD/d6OVIf7 5Z3A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NU8dWS3l; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-213234-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213234-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f855e380c1si12720095ad.64.2024.06.13.05.52.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 05:52:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213234-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NU8dWS3l; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-213234-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213234-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id AFE602829E6 for ; Thu, 13 Jun 2024 12:51:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AB5C11EEE0; Thu, 13 Jun 2024 12:51:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="NU8dWS3l" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37774A59; Thu, 13 Jun 2024 12:51:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718283111; cv=none; b=eTxVkw/GrXs4kIhEAGgnx13ad3QKO6364kPpByiVhO+z/Pf/XjLdj1RAmwZYwj0SssGEo6e0QJ0PyRpJV9iR5Cehj+tF3g67BiOqEVOOHbmI02MANBd0FiwU80tClvDRLLLFWSj5PDJsIETdmwm4XBvhd7mI3avmF/EmusvdDP4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718283111; c=relaxed/simple; bh=6LyP3wfrLYixy1o5n4KlFW881ICG5LISMvh5fSrySvY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gGoYMuM8Eqoo5s9cAfGP2M7+TolpyOPICc66xgIEQOmtxNPyVtkZ4L0XtXP9bqncks3dIEQpm4vVk+LwpmH/wpPnhp4gh2MIILJ8x07lt6mQqy2QfG78Bj5Fz+9GxZtOgRMGayoIn3IVdhZE4jr7vDpH+6wwPsknr61ZwzhjvwY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=NU8dWS3l; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718283110; x=1749819110; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=6LyP3wfrLYixy1o5n4KlFW881ICG5LISMvh5fSrySvY=; b=NU8dWS3lDO09/5hQsWy5CIgTaeS/MmkLGYs8HG+jmwTJFmXiQObSW44Y 4RBwwS05P94hHh74D8EvixndGWrwanTrGi1+B5u53HjvSDGUsLJGRoCkg N/WePmo9P18TRr+kaCpd2AW2Qc2xciJKux7ScSauW8whXi7jW77ji1OIW 8df1i45eB0IKdPO5KgmGWX3zSveak4xG8nho5KAMArHu+3JqsdlZvUFb4 WEHCoGKJ566TPe5WqBDR82AdHTm2z9+5L4VpIvD/LOj+XJq4IWGTcVrqg GoojBGOTUtufYOZRRg2XhVXpn4SIxXAsQ/Jo7v1zU7XhEI5kQ7VS/RR/2 Q==; X-CSE-ConnectionGUID: gn7wHnkqTr6/BE3Gs21IRw== X-CSE-MsgGUID: ubegmo4KQKKtHN3nARB+gA== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="18025197" X-IronPort-AV: E=Sophos;i="6.08,235,1712646000"; d="scan'208";a="18025197" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2024 05:51:49 -0700 X-CSE-ConnectionGUID: LjmylnObTAS6rHywtdaOZQ== X-CSE-MsgGUID: WMrWvny2QF+/4uxTwWbXPA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,235,1712646000"; d="scan'208";a="44574623" Received: from unknown (HELO tlindgre-MOBL1.intel.com) ([10.245.247.210]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2024 05:51:46 -0700 From: Tony Lindgren To: Greg Kroah-Hartman , Jiri Slaby , Petr Mladek , Steven Rostedt , John Ogness , Sergey Senozhatsky , Tony Lindgren , Andy Shevchenko Cc: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , linux-serial@vger.kernel.org, Tony Lindgren , linux-kernel@vger.kernel.org Subject: [PATCH v2 0/2] Fixes for console command line ordering Date: Thu, 13 Jun 2024 15:51:06 +0300 Message-ID: <20240613125113.219700-1-tony.lindgren@linux.intel.com> X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi, Recent changes to add support for DEVNAME:0.0 style consoles caused a regression with the preferred console order where the last console on the kernel command line is no longer the preferred console. The following two changes fix the issue using Petr's suggestion that does not involve calling __add_preferred_console() later on again, and adds the deferred consoles to the console_cmdline[] directly to be updated when the console is ready. We revert the earlier printk related changes, and then add back the DEVNAME:0.0 functionality based on Petr's code snippet. And we end up reducing the code quite a bit too this way. The reason we want DEVNAME:0.0 style consoles is it helps addressing the console based on the connected serial port controller device rather than using the hardcoded ttyS addressing. And that helps with issues related to the console moving around after togging the HSUART option in the BIOS, or when new ports are enabled in devicetree and aliases are not updated. Regards, Tony Changes since v1: - Revert the problem causing printk changes and switch to using the solution based on Petr's suggestion and code snippet Tony Lindgren (2): printk: Revert add_preferred_console_match() related commits printk: Add update_preferred_console() drivers/tty/serial/serial_base_bus.c | 2 +- include/linux/printk.h | 3 +- kernel/printk/Makefile | 2 +- kernel/printk/conopt.c | 146 --------------------------- kernel/printk/console_cmdline.h | 7 +- kernel/printk/printk.c | 96 ++++++++++++------ 6 files changed, 69 insertions(+), 187 deletions(-) delete mode 100644 kernel/printk/conopt.c base-commit: 83a7eefedc9b56fe7bfeff13b6c7356688ffa670 -- 2.45.2