All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sunhv: Fix device naming inconsistency between sunhv_console and sunhv_reg
@ 2019-06-11 15:38 John Paul Adrian Glaubitz
  2019-06-13 21:05 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: John Paul Adrian Glaubitz @ 2019-06-11 15:38 UTC (permalink / raw)
  To: sparclinux

In d5a2aa24, the name in struct console sunhv_console was changed from "ttyS"
to "ttyHV" while the name in struct uart_ops sunhv_pops remained unchanged.

This results in the hypervisor console device to be listed as "ttyHV0" under
/proc/consoles while the device node is still named "ttyS0":

root@osaka:~# cat /proc/consoles
ttyHV0               -W- (EC p  )    4:64
tty0                 -WU (E     )    4:1
root@osaka:~# readlink /sys/dev/char/4:64
../../devices/root/f02836f0/f0285690/tty/ttyS0
root@osaka:~#

This means that any userland code which tries to determine the name of the
device file of the hypervisor console device can not rely on the information
provided by /proc/consoles. In particular, booting current versions of debian-
installer inside a SPARC LDOM will fail with the installer unable to determine
the console device.

After renaming the device in struct uart_ops sunhv_pops to "ttyHV" as well,
the inconsistency is fixed and it is possible again to determine the name
of the device file of the hypervisor console device by reading the contents
of /proc/console:

root@osaka:~# cat /proc/consoles
ttyHV0               -W- (EC p  )    4:64
tty0                 -WU (E     )    4:1
root@osaka:~# readlink /sys/dev/char/4:64
../../devices/root/f02836f0/f0285690/tty/ttyHV0
root@osaka:~#

With this change, debian-installer works correctly when installing inside
a SPARC LDOM.

Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
---
 drivers/tty/serial/sunhv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c
index 63e34d868de8..f8503f8fc44e 100644
--- a/drivers/tty/serial/sunhv.c
+++ b/drivers/tty/serial/sunhv.c
@@ -397,7 +397,7 @@ static const struct uart_ops sunhv_pops = {
 static struct uart_driver sunhv_reg = {
 	.owner			= THIS_MODULE,
 	.driver_name		= "sunhv",
-	.dev_name		= "ttyS",
+	.dev_name		= "ttyHV",
 	.major			= TTY_MAJOR,
 };
 
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] sunhv: Fix device naming inconsistency between sunhv_console and sunhv_reg
  2019-06-11 15:38 [PATCH] sunhv: Fix device naming inconsistency between sunhv_console and sunhv_reg John Paul Adrian Glaubitz
@ 2019-06-13 21:05 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-06-13 21:05 UTC (permalink / raw)
  To: sparclinux

From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date: Tue, 11 Jun 2019 17:38:37 +0200

> In d5a2aa24, the name in struct console sunhv_console was changed from "ttyS"
> to "ttyHV" while the name in struct uart_ops sunhv_pops remained unchanged.
> 
> This results in the hypervisor console device to be listed as "ttyHV0" under
> /proc/consoles while the device node is still named "ttyS0":
> 
> root@osaka:~# cat /proc/consoles
> ttyHV0               -W- (EC p  )    4:64
> tty0                 -WU (E     )    4:1
> root@osaka:~# readlink /sys/dev/char/4:64
> ../../devices/root/f02836f0/f0285690/tty/ttyS0
> root@osaka:~#
> 
> This means that any userland code which tries to determine the name of the
> device file of the hypervisor console device can not rely on the information
> provided by /proc/consoles. In particular, booting current versions of debian-
> installer inside a SPARC LDOM will fail with the installer unable to determine
> the console device.
> 
> After renaming the device in struct uart_ops sunhv_pops to "ttyHV" as well,
> the inconsistency is fixed and it is possible again to determine the name
> of the device file of the hypervisor console device by reading the contents
> of /proc/console:
> 
> root@osaka:~# cat /proc/consoles
> ttyHV0               -W- (EC p  )    4:64
> tty0                 -WU (E     )    4:1
> root@osaka:~# readlink /sys/dev/char/4:64
> ../../devices/root/f02836f0/f0285690/tty/ttyHV0
> root@osaka:~#
> 
> With this change, debian-installer works correctly when installing inside
> a SPARC LDOM.
> 
> Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-13 21:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-11 15:38 [PATCH] sunhv: Fix device naming inconsistency between sunhv_console and sunhv_reg John Paul Adrian Glaubitz
2019-06-13 21:05 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.