Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp303803yba; Thu, 25 Apr 2019 23:47:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGfwjd4yiOuE8rvFt314ZVO3/Zv8rI58pNT1KWQULC1q7GFHhxVg4kTK0FKlhwNUXbXv7W X-Received: by 2002:a17:902:a583:: with SMTP id az3mr44607420plb.205.1556261258465; Thu, 25 Apr 2019 23:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556261258; cv=none; d=google.com; s=arc-20160816; b=zzwp/j5HznZX2sUe1m8XA3VafeeSsc6rh+dWj4aRdy2T9Dub9J8/8yi/pfH6imqB5r UX6G9CCimeTkLd/yjptvxRFhMuJNND5t//x2rU/dfVRJFmUPI0X+CJIQcoOEwegfU2of V86ZpgECcSk0M1T7zQhv7dWfqozRBNeUR9a0aVoDXaOt68IBHHfWqv0blfaLOREVWZ1L QvvxCf/upmPBZJ3TIPwYYLBCPE5xf3N05C3hYJ0BJKzAe8wMaTqDO/FZGqFDCMz5VDNR D8vdKC+tSB4lrqzXw1F89zE1WvFe4Td+hWsLZBv6oR7QI2yCODkGguGzqzVm3eYmfqpK FXBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=MHfiL2ALiZrSpzP8Kz5apkSsL4ZLblvwvjS3oOXzqXk=; b=eZpEvjXTSu8V/Bl5THHjtF12tJ2u92qhmm00RNB8jlRc/hWPOfLKi4O5ux2RDw0RsE I/nS69a/CcA3JX0JfkAJUd4981YOUoyCzRdQ3nYlNvbBiknb/Jv3C4rDjOJrIXzJf4U2 ciQimEGTm9wBL1ljHlXm1aHeqsNuXvSi9ldTdbgqbRJa40CmbxqYQrubDkYIouxdesLm BwcXOISuGDQ+Q/7Ay8qj5P3GX2us+HlehiG54SfceNW2hjxAfO6gmsgAJLoNVgC6FMeI jnp5PEuNhL/BT6OaCzeKs8HYjhARtdQ/hXvT4f8bWokc+BRIvg66jOlPjGYHHTwNAa6m hS3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=B956XR0E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s18si24056558plq.244.2019.04.25.23.47.23; Thu, 25 Apr 2019 23:47:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=B956XR0E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726924AbfDZGVb (ORCPT + 99 others); Fri, 26 Apr 2019 02:21:31 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:45877 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725800AbfDZGVb (ORCPT ); Fri, 26 Apr 2019 02:21:31 -0400 Received: by mail-wr1-f66.google.com with SMTP id s15so2700363wra.12 for ; Thu, 25 Apr 2019 23:21:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MHfiL2ALiZrSpzP8Kz5apkSsL4ZLblvwvjS3oOXzqXk=; b=B956XR0Eab0mcPJVqmnXubGaXKdRJSpLE2iuIY2JYwklVmRrjvhL1qNiYicGGkfABn ZR1+t06pXO4f0HLR5yVsACP+00Ie9hrPYOCr9I8E9P1gZSagIYWOaa4wPyJY4m+ozJH3 ecZXwI6VI6UmbAxpCiTR8feoS9An579k740dQnTWSC//24tw1b5hrmdQoxu8iF5syE9r r+h84Z/9Ec+z6wCwKJfgejHMqmB6HJjllD+pYC2qoVGWqoG4Cynwur6RO0yHLRpcrsXl 5OwiJPTI8IK6edEaGcJsWkjUATZ07GLYQjo0FKJYA3LtLxM9+7yq7ZkNZDlLv0XInXux 6ydQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MHfiL2ALiZrSpzP8Kz5apkSsL4ZLblvwvjS3oOXzqXk=; b=qow1fUrePylHfbEn34xhw8b1zDOvHTOFQfZwFL2WNvzxhOX1rE3yWuav05vEJZprIT AYGXkA3mDS0nkAJZGSwFz/qLnltMG21+IuYU3bUif00vHtGb8cSiLPU0FpGoUNtSlCfG hX0QD0mdf9LDF7JPy79J8DHrmW2dyKclNu9Lv+WAhEfFe7pVkMZRZDbZSJEkaMBlTvGO syLR5zH4i+hVi8nS6Tjz4ZJ/mtH8ghLRYPPo4NONyg9isQt8oC5Qb98zpVLgt5ttEFlI XJu+u+qLhjui6AVQED0yAkqbRHfRg21eJtBRl4HgJ9/5Yyg6QaCatmhb82Oj4T40OVbq 0uDA== X-Gm-Message-State: APjAAAUwArNUfUqXtxL8J7xZXDOelbhcde5+yfCuMIxH1CA+edTGxWmP SWbRPMAU+0z6DLgBGpdrzIZ54tkR9LVErgEPbFlcKg== X-Received: by 2002:a5d:5108:: with SMTP id s8mr26165281wrt.99.1556259689461; Thu, 25 Apr 2019 23:21:29 -0700 (PDT) MIME-Version: 1.0 References: <20190425133435.56065-1-anup.patel@wdc.com> <9a8be7ef-e62e-2a93-9170-e3dc70dfb25f@wdc.com> In-Reply-To: <9a8be7ef-e62e-2a93-9170-e3dc70dfb25f@wdc.com> From: Anup Patel Date: Fri, 26 Apr 2019 11:51:18 +0530 Message-ID: Subject: Re: [PATCH] tty: Don't force RISCV SBI console as preferred console To: Atish Patra Cc: Anup Patel , Greg Kroah-Hartman , Jiri Slaby , Palmer Dabbelt , Albert Ou , Christoph Hellwig , "linux-riscv@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 26, 2019 at 10:11 AM Atish Patra wrote: > > On 4/25/19 6:35 AM, Anup Patel wrote: > > The Linux kernel will auto-disables all boot consoles whenever it > > gets a preferred real console. > > > > Currently on RISC-V systems, if we have a real console which is not > > RISCV SBI console then boot consoles (such as earlycon=sbi) are not > > auto-disabled when a real console (ttyS0 or ttySIF0) is available. > > This results in duplicate prints at boot-time after kernel starts > > using real console (i.e. ttyS0 or ttySIF0) if "earlycon=" kernel > > parameter was passed by bootloader. > > > > The reason for above issue is that RISCV SBI console always adds > > itself as preferred console which is causing other real consoles > > to be not used as preferred console. > > > > Do we even need HVC_SBI console to be enabled by default? Disabling > CONFIG_HVC_RISCV_SBI seems to be fine while running in QEMU. Actually, HVC_SBI console is useful on boards (such as SiFive Unleashed) lacking upstream serial driver. It allows us to boot upstream kernel to prompt on such boards with just timer driver (and probably irqchip driver). Also, we should be able to use same kernel image on QEMU and SiFive Unleashed board so disabling CONFIG_HVC_RISCV_SBI for QEMU is a temporary solution. > > If we don't need it, I suggest we should remove the config option from > defconfig in addition to this patch. Like mentioned above, HVC_SBI is useful for newer SOCs and boards where serial driver is not yet up-streamed. Regards, Anup > > Regards, > Atish > > Ideally "console=" kernel parameter passed by bootloaders should > > be the one selecting a preferred real console. > > > > This patch fixes above issue by not forcing RISCV SBI console as > > preferred console. > > > > Fixes: afa6b1ccfad5 ("tty: New RISC-V SBI console driver") > > Cc: stable@vger.kernel.org > > Signed-off-by: Anup Patel > > --- > > drivers/tty/hvc/hvc_riscv_sbi.c | 1 - > > 1 file changed, 1 deletion(-) > > > > diff --git a/drivers/tty/hvc/hvc_riscv_sbi.c b/drivers/tty/hvc/hvc_riscv_sbi.c > > index 75155bde2b88..31f53fa77e4a 100644 > > --- a/drivers/tty/hvc/hvc_riscv_sbi.c > > +++ b/drivers/tty/hvc/hvc_riscv_sbi.c > > @@ -53,7 +53,6 @@ device_initcall(hvc_sbi_init); > > static int __init hvc_sbi_console_init(void) > > { > > hvc_instantiate(0, 0, &hvc_sbi_ops); > > - add_preferred_console("hvc", 0, NULL); > > > > return 0; > > } > > >