]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.19.54/sunhv-fix-device-naming-inconsistency-between-sunhv_console-and-sunhv_reg.patch
Linux 4.19.54
[thirdparty/kernel/stable-queue.git] / releases / 4.19.54 / sunhv-fix-device-naming-inconsistency-between-sunhv_console-and-sunhv_reg.patch
CommitLineData
cc95841f
GKH
1From foo@baz Wed 19 Jun 2019 02:34:37 PM CEST
2From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
3Date: Tue, 11 Jun 2019 17:38:37 +0200
4Subject: sunhv: Fix device naming inconsistency between sunhv_console and sunhv_reg
5
6From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
7
8[ Upstream commit 07a6d63eb1b54b5fb38092780fe618dfe1d96e23 ]
9
10In d5a2aa24, the name in struct console sunhv_console was changed from "ttyS"
11to "ttyHV" while the name in struct uart_ops sunhv_pops remained unchanged.
12
13This results in the hypervisor console device to be listed as "ttyHV0" under
14/proc/consoles while the device node is still named "ttyS0":
15
16root@osaka:~# cat /proc/consoles
17ttyHV0 -W- (EC p ) 4:64
18tty0 -WU (E ) 4:1
19root@osaka:~# readlink /sys/dev/char/4:64
20../../devices/root/f02836f0/f0285690/tty/ttyS0
21root@osaka:~#
22
23This means that any userland code which tries to determine the name of the
24device file of the hypervisor console device can not rely on the information
25provided by /proc/consoles. In particular, booting current versions of debian-
26installer inside a SPARC LDOM will fail with the installer unable to determine
27the console device.
28
29After renaming the device in struct uart_ops sunhv_pops to "ttyHV" as well,
30the inconsistency is fixed and it is possible again to determine the name
31of the device file of the hypervisor console device by reading the contents
32of /proc/console:
33
34root@osaka:~# cat /proc/consoles
35ttyHV0 -W- (EC p ) 4:64
36tty0 -WU (E ) 4:1
37root@osaka:~# readlink /sys/dev/char/4:64
38../../devices/root/f02836f0/f0285690/tty/ttyHV0
39root@osaka:~#
40
41With this change, debian-installer works correctly when installing inside
42a SPARC LDOM.
43
44Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
45Signed-off-by: David S. Miller <davem@davemloft.net>
46Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
47---
48 drivers/tty/serial/sunhv.c | 2 +-
49 1 file changed, 1 insertion(+), 1 deletion(-)
50
51--- a/drivers/tty/serial/sunhv.c
52+++ b/drivers/tty/serial/sunhv.c
53@@ -397,7 +397,7 @@ static const struct uart_ops sunhv_pops
54 static struct uart_driver sunhv_reg = {
55 .owner = THIS_MODULE,
56 .driver_name = "sunhv",
57- .dev_name = "ttyS",
58+ .dev_name = "ttyHV",
59 .major = TTY_MAJOR,
60 };
61