lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240912113616.2.Id2235082fc6c2d238789dfc3ee923492e9ed7387@changeid>
Date: Thu, 12 Sep 2024 11:36:20 -0600
From: Raul E Rangel <rrangel@...omium.org>
To: linux-serial@...r.kernel.org
Cc: pmladek@...e.com,
	rafael.j.wysocki@...el.com,
	ribalda@...omium.org,
	Raul E Rangel <rrangel@...omium.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jiri Slaby <jirislaby@...nel.org>,
	linux-kernel@...r.kernel.org
Subject: [PATCH 2/3] earlycon: Print a notice when uartclk is unknown

When trying to construct an earlycon=uart parameter it's hard to debug
why it's not working.  In my specific case it was because the default
uartclk earlycon assumes doesn't match my hardware. This change adds a
notice so that the user is made aware of that this assumption is being
made. This should hopefully lead to them adding a <uartclk> option to
their earlycon parameter.

Booting with `console=uart,mmio32,0xfedc9000,115200n8`:
[    0.000000] earlycon: uart: Unknown uartclk, assuming 1843200hz
[    0.000000] earlycon: uart0 at MMIO32 0x00000000fedc9000 (options '115200n8')

Signed-off-by: Raul E Rangel <rrangel@...omium.org>

---

 drivers/tty/serial/earlycon.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index ab9af37f6cda35..5a8fe0cb3b1986 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -145,8 +145,12 @@ static int __init register_earlycon(char *buf, const struct earlycon_id *match)
 		buf = NULL;
 
 	spin_lock_init(&port->lock);
-	if (!port->uartclk)
+	if (!port->uartclk) {
 		port->uartclk = BASE_BAUD * 16;
+		if (early_console_dev.baud)
+			pr_notice("%s: Unknown uartclk, assuming %dhz",
+				  match->name, port->uartclk);
+	}
 	if (port->mapbase)
 		port->membase = earlycon_map(port->mapbase, 64);
 
-- 
2.46.0.662.g92d0881bb0-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ