]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/tty-don-t-force-riscv-sbi-console-as-preferred-console.patch
1e9c1f899d8a71b36597490c7375240cca20c6d1
[thirdparty/kernel/stable-queue.git] / queue-4.19 / tty-don-t-force-riscv-sbi-console-as-preferred-console.patch
1 From f91253a3d005796404ae0e578b3394459b5f9b71 Mon Sep 17 00:00:00 2001
2 From: Anup Patel <Anup.Patel@wdc.com>
3 Date: Thu, 25 Apr 2019 06:35:06 -0700
4 Subject: tty: Don't force RISCV SBI console as preferred console
5
6 From: Anup Patel <Anup.Patel@wdc.com>
7
8 commit f91253a3d005796404ae0e578b3394459b5f9b71 upstream.
9
10 The Linux kernel will auto-disables all boot consoles whenever it
11 gets a preferred real console.
12
13 Currently on RISC-V systems, if we have a real console which is not
14 RISCV SBI console then boot consoles (such as earlycon=sbi) are not
15 auto-disabled when a real console (ttyS0 or ttySIF0) is available.
16 This results in duplicate prints at boot-time after kernel starts
17 using real console (i.e. ttyS0 or ttySIF0) if "earlycon=" kernel
18 parameter was passed by bootloader.
19
20 The reason for above issue is that RISCV SBI console always adds
21 itself as preferred console which is causing other real consoles
22 to be not used as preferred console.
23
24 Ideally "console=" kernel parameter passed by bootloaders should
25 be the one selecting a preferred real console.
26
27 This patch fixes above issue by not forcing RISCV SBI console as
28 preferred console.
29
30 Fixes: afa6b1ccfad5 ("tty: New RISC-V SBI console driver")
31 Cc: stable@vger.kernel.org
32 Signed-off-by: Anup Patel <anup.patel@wdc.com>
33 Reviewed-by: Atish Patra <atish.patra@wdc.com>
34 Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
35 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
36
37 ---
38 drivers/tty/hvc/hvc_riscv_sbi.c | 1 -
39 1 file changed, 1 deletion(-)
40
41 --- a/drivers/tty/hvc/hvc_riscv_sbi.c
42 +++ b/drivers/tty/hvc/hvc_riscv_sbi.c
43 @@ -53,7 +53,6 @@ device_initcall(hvc_sbi_init);
44 static int __init hvc_sbi_console_init(void)
45 {
46 hvc_instantiate(0, 0, &hvc_sbi_ops);
47 - add_preferred_console("hvc", 0, NULL);
48
49 return 0;
50 }