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: <20161206175830.6989-3-aleksey.makarov@linaro.org>
Date:   Tue,  6 Dec 2016 23:58:27 +0600
From:   Aleksey Makarov <aleksey.makarov@...aro.org>
To:     "Rafael J . Wysocki" <rjw@...ysocki.net>
Cc:     linux-acpi@...r.kernel.org, linux-serial@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Russell King <linux@....linux.org.uk>,
        Peter Hurley <peter@...leysoftware.com>,
        Aleksey Makarov <aleksey.makarov@...aro.org>,
        Jon Masters <jcm@...hat.com>, Mark Salter <msalter@...hat.com>,
        Duc Dang <dhdang@....com>, Rob Herring <robh@...nel.org>,
        Len Brown <lenb@...nel.org>
Subject: [RFC v2 2/4] ACPI: SPCR: don't initialize baud rate

AppliedMicro X-Gene based boards don't use the "standard"
16550 clock rate so supplying a baud rate makes it change
to a random baud rate.

I suggest to introduce a new value '0' for the "Baud
Rate" field of SPCR (now this value is reserved).

This patch introduces a check for this value.  In this case
the code does not emit baud rate specification for initialization
of the console.

Signed-off-by: Aleksey Makarov <aleksey.makarov@...aro.org>
---
 drivers/acpi/spcr.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
index 6c6710b..2bf338c 100644
--- a/drivers/acpi/spcr.c
+++ b/drivers/acpi/spcr.c
@@ -37,7 +37,7 @@ int __init parse_spcr(bool earlycon)
 	acpi_status status;
 	char *uart;
 	char *iotype;
-	int baud_rate;
+	char *baud_rate_string;
 	int err;
 
 	if (acpi_disabled)
@@ -82,25 +82,33 @@ int __init parse_spcr(bool earlycon)
 	}
 
 	switch (table->baud_rate) {
+	case 0:
+		/*
+		 * This value is not standaritzed by ACPI SPCR for now.
+		 * It means that hardware should not be re-initialized with
+		 * new speed.
+		 */
+		baud_rate_string = "";
+		break;
 	case 3:
-		baud_rate = 9600;
+		baud_rate_string = ",9600";
 		break;
 	case 4:
-		baud_rate = 19200;
+		baud_rate_string = ",19200";
 		break;
 	case 6:
-		baud_rate = 57600;
+		baud_rate_string = ",57600";
 		break;
 	case 7:
-		baud_rate = 115200;
+		baud_rate_string = ",115200";
 		break;
 	default:
 		err = -ENOENT;
 		goto done;
 	}
 
-	snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype,
-		 table->serial_port.address, baud_rate);
+	snprintf(opts, sizeof(opts), "%s,%s,0x%llx%s", uart, iotype,
+		 table->serial_port.address, baud_rate_string);
 
 	pr_info("console: %s\n", opts);
 
-- 
2.10.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ