Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2011835ybz; Thu, 30 Apr 2020 09:18:23 -0700 (PDT) X-Google-Smtp-Source: APiQypLE41TH9gHhe41QFT1HTK0SBR/+xH6sUVvG0FJdCEP71EwPVh6YsmxxXJu7DYeMRgEHajhH X-Received: by 2002:a50:9b0f:: with SMTP id o15mr3511386edi.325.1588263502894; Thu, 30 Apr 2020 09:18:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588263502; cv=none; d=google.com; s=arc-20160816; b=Tn8qVD8lur7VvRaFSR5wc2Je16MU+LUou9j0ZTiNKE2CnayfR6a3JVgROJVuUztA1W WdVyB6Au6xVdYGXkrQy/zg01SSB9h5TT4Nj+okSV2evkTTeDrY1ph2cRfIRS3CkOwpKc eYEyMOO/fqzel1rvuloBkxQS2kkjAmTw/Y/yE+2AAfG9zuHZSnLbVsIpYqbl5iqDc3W6 kI3Yg5/wwBFBpa/P9xQ4m2J5IPIOhdyxJ5iyyc9tcVaCfXYRWH7elrj66KjNqxhPGSyf BCFvFuXaTYsEniR6jeIVBskwrjprH8uGpiO7SEOXT3CywEk+bO2AI4tMJQSv4SiDruBR Qcpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=vHCcWfIEICV286PlzrlDhon26egExA0EzSmCUey5zx8=; b=J46QEK3gKQF6wp/TnmhHt+siP5ybJTyU5bDvOuFQpEPCG5dD7y0BTtsUZ1N7WnD8Om vGcWdVHBGz1S9HL+144ngliNFSXpuVHXipoe4YHtGKHBvodcwGY52m5g84WOJ9J4tI25 FKzhGxDyiQ2X4mnP+OKtNpioun5m4PKX6UoHCrrdCfjBD+HunSghhPXh/zALAS7TyayX +osKcrVLfCjd0XiH3UDm0uEz81Wx4zjcg/NBX4uxJIS0/ns+Pmlpdiuw+7WHXcIH5WXW Hqkbb7+0BtTGsKaN1Y3EW/EmE95TUibM6Vv9rbXvHkZq/L0bmfhs0S9hQlNGOgb6c7n3 aEyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ay5tSMlw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x21si37076edv.235.2020.04.30.09.17.58; Thu, 30 Apr 2020 09:18:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ay5tSMlw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727807AbgD3QQ1 (ORCPT + 99 others); Thu, 30 Apr 2020 12:16:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726405AbgD3QQ0 (ORCPT ); Thu, 30 Apr 2020 12:16:26 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0303CC035494; Thu, 30 Apr 2020 09:16:25 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id b20so1437430lff.2; Thu, 30 Apr 2020 09:16:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vHCcWfIEICV286PlzrlDhon26egExA0EzSmCUey5zx8=; b=ay5tSMlwbsTytMC7115ZGRlTIa6ajZl389PdP5rwRFjVdI2WdoqyVsj71qOrQeG4+3 UKYJyxd/cA0ur6rCIOqf1Ews+8L98JgIF6F+ljKM85bXDLpHp+CnOLJjuE3bBFLuyRnY o/O3wePvR7bcNfq9OBC9q5xozmSaVSjKIlBgWdN5mX7JueVbkl63GNBkBR1NGUwfwGMM g4ub0uMZ3dn7BqOxtEc7rOu5zDyTR2VThEy7nizswgYtakMsJQ4tP2QAPHFiUMLbw9aA wTlUdDTBuWbEL4G2S75g8ppTLzaeLz5Uf3/9Nh/6mK2rkLJt7KevDilZvGEh3nYSuwNd Mh4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vHCcWfIEICV286PlzrlDhon26egExA0EzSmCUey5zx8=; b=RaVoHYHtIe4x/pDbYrAC43INUVHlLQ1ynZLoe1me9JNXS+UMcea6aE8bwQTFK9eYBB xUV4dI7Cis8lx74sk2KPl239A3lKf8f1eFTptrWvO3mHL8wMVq3A4jjb6o0LerlAdZZC qYfWtS4wNOMuk+xZat54d7CaXoAL4MFake34JA0Xs1b/tJ2aWZW8k+9nYiVyw8tIjw9o tI/XSZl5q7e93QeVQO75taZjaoVY8TiBsyVD1n+bkGx0isfg7Nuz8mfV0BPlv1DYsMoM HlOwOGDyIsdC2/2lE8ohSbg9fcXDIqaD1qfRHgq4iuMYTvQsqfux463QPRAnZ350VlZc xs4g== X-Gm-Message-State: AGi0PuY41hKhUhI8A3RDN+21EXC/ErS1rX+1pQYLnXfbC8oUEXH+CJXF zrPuaQHLuQf6ARxM1+a/YGQ= X-Received: by 2002:ac2:489b:: with SMTP id x27mr2746373lfc.60.1588263383459; Thu, 30 Apr 2020 09:16:23 -0700 (PDT) Received: from localhost.localdomain ([178.233.178.9]) by smtp.gmail.com with ESMTPSA id k6sm60638lfm.91.2020.04.30.09.16.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 09:16:22 -0700 (PDT) From: Alper Nebi Yasak To: Greg Kroah-Hartman , Jiri Slaby , Petr Mladek , Sergey Senozhatsky Cc: linux-serial@vger.kernel.org, Steven Rostedt , Alper Nebi Yasak , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Andrew Morton , Andy Shevchenko , Arvind Sankar , Benjamin Herrenschmidt , Daniel Vetter , "David S. Miller" , Eric Biggers , Feng Tang , Grzegorz Halat , Lukas Wunner , Nicolas Pitre , Sam Ravnborg Subject: [RFC PATCH v2 0/3] Prefer working VT console over SPCR and device-tree chosen stdout-path Date: Thu, 30 Apr 2020 19:14:34 +0300 Message-Id: <20200430161438.17640-1-alpernebiyasak@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I recently experienced some trouble with setting up an encrypted-root system, my Chromebook Plus (rk3399-gru-kevin, ARM64) would appear to hang where it should have asked for an encryption passphrase; and I eventually figured out that the kernel preferred the serial port (inaccessible to me) over the built-in working display/keyboard and was probably asking there. Running plymouth in the initramfs solves that specific problem, but both the documentation and tty-related kconfig descriptions imply that /dev/console should be tty0 if graphics are working, CONFIG_VT_CONSOLE is enabled and no explicit console argument is given in the kernel commandline. However, I'm seeing different behaviour on systems with SPCR (as in QEMU aarch64 virtual machines) and/or a device-tree chosen stdout-path node (as in most arm/arm64 devices). On these machines, depending on the console argument, the contents of the /proc/consoles file are: | "console=tty0" | (no console arg) | ------------------+-----------------------+-----------------------+ QEMU VM | tty0 -WU (EC p ) | ttyAMA0 -W- (EC a) | (w/ SPCR) | ttyAMA0 -W- (E a) | | ------------------+-----------------------+-----------------------+ Chromebook Plus | tty0 -WU (EC p ) | ttyS2 -W- (EC p a) | (w/ stdout-path) | | tty0 -WU (E ) | ------------------+-----------------------+-----------------------+ Chromebook Plus | tty0 -WU (EC p ) | tty0 -WU (EC p ) | (w/o either) | | | ------------------+-----------------------+-----------------------+ This patchset tries to ensure that VT is preferred in those conditions even in the presence of firmware-mandated serial consoles. These should cleanly apply onto next-20200430. More discussion due to or about the console confusion on ARM64: - My Debian bug report about the initramfs prompts [0] - Fedora test issue arising from ARM64 QEMU machines having SPCR [1] - Debian-installer discussion on what to do with multiple consoles [2] [0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=952452 [1] https://bugzilla.redhat.com/show_bug.cgi?id=1661288 [2] https://lists.debian.org/debian-boot/2019/01/msg00184.html Changes in v2: - Fix #elif to #else (Reported-by: kbuild test robot ) - Refresh dmesg outputs with/without earlycon for next-20200430 - Use the correct format when referencing a commit Alper Nebi Yasak (3): printk: Add function to set console to preferred console's driver vt: Set as preferred console when a non-dummy backend is bound printk: Preset tty0 as a pseudo-preferred console drivers/tty/vt/vt.c | 7 +++++ include/linux/console.h | 1 + kernel/printk/printk.c | 68 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+) -- 2.26.2