]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.14/acpi-spcr-consider-baud-rate-0-as-preconfigured-stat.patch
autosel patches for 4.14
[thirdparty/kernel/stable-queue.git] / queue-4.14 / acpi-spcr-consider-baud-rate-0-as-preconfigured-stat.patch
1 From 56cc31513311b73874e05d23e2429bf31e1441c2 Mon Sep 17 00:00:00 2001
2 From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
3 Date: Wed, 21 Nov 2018 15:43:37 +0200
4 Subject: ACPI: SPCR: Consider baud rate 0 as preconfigured state
5
6 [ Upstream commit b413b1abeb21b4a152c0bf8d1379efa30759b6e3 ]
7
8 Since SPCR 1.04 [1] the baud rate of 0 means a preconfigured state of UART.
9 Assume firmware or bootloader configures console correctly.
10
11 [1]: https://docs.microsoft.com/en-us/windows-hardware/drivers/serports/serial-port-console-redirection-table
12
13 Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
14 Reviewed-by: Prarit Bhargava <prarit@redhat.com>
15 Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
16 Signed-off-by: Sasha Levin <sashal@kernel.org>
17 ---
18 drivers/acpi/spcr.c | 11 +++++++++++
19 1 file changed, 11 insertions(+)
20
21 diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
22 index 324b35bfe781..f567fa5f0148 100644
23 --- a/drivers/acpi/spcr.c
24 +++ b/drivers/acpi/spcr.c
25 @@ -148,6 +148,13 @@ int __init parse_spcr(bool earlycon)
26 }
27
28 switch (table->baud_rate) {
29 + case 0:
30 + /*
31 + * SPCR 1.04 defines 0 as a preconfigured state of UART.
32 + * Assume firmware or bootloader configures console correctly.
33 + */
34 + baud_rate = 0;
35 + break;
36 case 3:
37 baud_rate = 9600;
38 break;
39 @@ -196,6 +203,10 @@ int __init parse_spcr(bool earlycon)
40 * UART so don't attempt to change to the baud rate state
41 * in the table because driver cannot calculate the dividers
42 */
43 + baud_rate = 0;
44 + }
45 +
46 + if (!baud_rate) {
47 snprintf(opts, sizeof(opts), "%s,%s,0x%llx", uart, iotype,
48 table->serial_port.address);
49 } else {
50 --
51 2.19.1
52