Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2650590imj; Mon, 11 Feb 2019 06:28:54 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib+IOqhx9bfzeeSsFqXY/wucdcRK8hellMsXEcVKteof/p24UQjlnkPaFV0IfedFWmR1+E1 X-Received: by 2002:a62:43c5:: with SMTP id l66mr37209376pfi.207.1549895333918; Mon, 11 Feb 2019 06:28:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895333; cv=none; d=google.com; s=arc-20160816; b=Gb47YCltwI0wBQyNNegbOHe7TiOjxTLZrhXwO4uU9iyVdNNaEG5DEGt4X1GLn4eVUV mafRzyH1ZfG8lJKrwLzq//2E9hX36gB0DO461gvSXdOwcFJho8mrp85SAaGdSVBYynws iVFpKbsd9YCYYpNJSun/297C/p5rxTJXc6/BLLfoRTvgZRHAYTFvVsq1IcqLml25q9dg NHlSWK0QXCFWQ7vI+b7vbvZAtaHc5AB98MTglruaGql+3JLdLJyEuMpR821QzkH43ZaQ nRaynIzlgJ6MSiM+u84IrTwZfFDYIVeDctc0cW4KPMP983IGmBCHUAJcxt6ozmncFeWd tijQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ncd9I0cH/fgguqLfgDjqT/5+cBadZsfyCazi7PS2xjk=; b=XMISRILYILgle988JCewIQGlV8/mNjURiEw71CW+Tnp6K2Jye6Lt0FO/fVFwC40HIE Y0n51OF7hGU8P2pciZ6ZSfFrg8YAzFRXIYVi6jc/bBWCbaHDSHUknzlCeoNEzfQBz1Kf bwtXzFujpTiq8TDISVA5IigIBtUpnoWktyz9iGwqnuBB+spNsUNNOmufeChL0VBlRR99 ORy5dk9DjNk9lRUX3DiZMPTtJ8Ab2IqzCTQQmAEIUCRMN19AlLwANG6MGdYLLEkIy6qb Desd5SzwdJI6CdxZ87W5Rc0Mx3EDWnVFIjv+RuOOcj58fNDgUjGGW8BgAcoqU8Qplw+b Ilyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wyP3QgtF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si8610650plo.189.2019.02.11.06.28.37; Mon, 11 Feb 2019 06:28:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wyP3QgtF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729253AbfBKOYk (ORCPT + 99 others); Mon, 11 Feb 2019 09:24:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:57908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729242AbfBKOYi (ORCPT ); Mon, 11 Feb 2019 09:24:38 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E70642075C; Mon, 11 Feb 2019 14:24:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895078; bh=w5WSb/uEfpoz2iAjZ2JSfX3Bn7DGypH0y3LbchJEjzU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wyP3QgtFBNYwhf+3oqn8OWBSnF9czKrgB3Qna6mozrwatCmhG5KDUoc+OJbDk6lxT 9NzkkEKx/zpSp4iBP5me+9/G/GMYruXDNCLO+KGTH0Hoaeo/D5310Dq1HPInK8qATb k+XG/gZAgVqdPqKLbKqmnEYUJJPmzSqUJfJFJ41Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Shevchenko , Prarit Bhargava , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 4.20 077/352] ACPI: SPCR: Consider baud rate 0 as preconfigured state Date: Mon, 11 Feb 2019 15:15:04 +0100 Message-Id: <20190211141850.947607772@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit b413b1abeb21b4a152c0bf8d1379efa30759b6e3 ] Since SPCR 1.04 [1] the baud rate of 0 means a preconfigured state of UART. Assume firmware or bootloader configures console correctly. [1]: https://docs.microsoft.com/en-us/windows-hardware/drivers/serports/serial-port-console-redirection-table Signed-off-by: Andy Shevchenko Reviewed-by: Prarit Bhargava Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/spcr.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c index 9d52743080a4..c336784d0bcb 100644 --- a/drivers/acpi/spcr.c +++ b/drivers/acpi/spcr.c @@ -148,6 +148,13 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console) } switch (table->baud_rate) { + case 0: + /* + * SPCR 1.04 defines 0 as a preconfigured state of UART. + * Assume firmware or bootloader configures console correctly. + */ + baud_rate = 0; + break; case 3: baud_rate = 9600; break; @@ -196,6 +203,10 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console) * UART so don't attempt to change to the baud rate state * in the table because driver cannot calculate the dividers */ + baud_rate = 0; + } + + if (!baud_rate) { snprintf(opts, sizeof(opts), "%s,%s,0x%llx", uart, iotype, table->serial_port.address); } else { -- 2.19.1