git: 17a4a163df85 - main - Revert "Fill in cn_name in struct consdev."

From: Jessica Clarke <jrtc27_at_FreeBSD.org>
Date: Sat, 23 Jul 2022 21:44:25 UTC
The branch main has been updated by jrtc27:

URL: https://cgit.FreeBSD.org/src/commit/?id=17a4a163df85e2cbe20e4fbdb03c56085e8079e6

commit 17a4a163df85e2cbe20e4fbdb03c56085e8079e6
Author:     Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2022-07-23 21:44:19 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2022-07-23 21:44:19 +0000

    Revert "Fill in cn_name in struct consdev."
    
    This reverts commit 82a21151cf1d7a3e9e95b9edbbf74ac10f386d6a.
    
    This commit was made to aid debugging before consoles are initialised so
    that they can more easily be identified from a debugger. However,
    various consoles (cfecons, ofwcons, mambocons and rcons) all check
    whether cn_name[0] is non-zero to see they are attached or not, and so
    this breaks that (perhaps misguided) approach. On RISC-V this results in
    rcons (the SBI firmware console driver) racing with the real UART driver
    and so input gets probabilistically lost on the real UART (around 2/3 of
    the time for me on QEMU).
    
    Moreover, the name given to CONSOLE_DRIVER isn't necessarily the same as
    what eventually gets written to cn_name, such as cfecons vs cfe, rcons
    vs riscv, ttyj0 vs aju, ttyv0 vs sc, ttyuN vs uart_phyp/opal and all
    manner of things vs ucom, so in some cases this is in fact misleading as
    the name will change after attaching.
    
    Discussed with: cperciva
---
 sys/sys/cons.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sys/sys/cons.h b/sys/sys/cons.h
index fec7f6c01b84..ad73b258df6d 100644
--- a/sys/sys/cons.h
+++ b/sys/sys/cons.h
@@ -104,7 +104,6 @@ extern	struct tty *constty;	/* Temporary virtual console. */
 	static struct consdev name = {					\
 		.cn_ops = &ops,						\
 		.cn_arg = (arg),					\
-		.cn_name = #name,					\
 	};								\
 	DATA_SET(cons_set, name)