Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3625866imu; Mon, 28 Jan 2019 08:03:50 -0800 (PST) X-Google-Smtp-Source: ALg8bN6el1+3+nwcjvWr32zLukBKnB9vUUAcU8g8fANzeezFswfmz/Fhpx2dwZNXSkU+St8mPf0h X-Received: by 2002:a63:4f20:: with SMTP id d32mr20242898pgb.47.1548691430378; Mon, 28 Jan 2019 08:03:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548691430; cv=none; d=google.com; s=arc-20160816; b=KdeFjIZsiDg8mDLz8ABCGuuc6ZxfuRlcrNCYYJz2HzxEllKNSFloqF2w4q/RKlF301 SZX8ng8bXBdZsDoTXBlWNah+mpGwZelKiux/hmzXI/eidASJj23goMVuOheHC3xNtWB2 EOOl2Vi2r6KbOoQ/SJxTl61bg7Aum6quDA6PRZA3y79J+qQp9tc5bZDL6v5IKnfBEtZZ RfoKHXQd70wTwp09S6ooGRxq8ePpaeqTTuSc18tl1Cu9UVzOhVu8uX7XHPINpllFweeq phRdPewBYPCkwLfjOJhINyEXyEDOx25OthycbQNUWoYvdlZBuof34iGeSIG34atJrIb7 Ve+A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/PZAJjV8GZDHgU0BqlhUGWulo+mYvvHlsq5e/Zr06aw=; b=XvOFsXnK80NzuaXNujEPW3wcj0vTIpYcrX1WhLoONvIHdg1+xO1b+d/kmfMHqHixrj 1/rAqaOFoE16BnEAaHdcnMfS2afC28bxBaUKfng4jGucE9LdTHrnK/uRgxnoomMZAXrJ jO1zuTbBHd7FSw7oZ7biEZbIzEzkiCL1Dn+taj4BDAPpIp4GXVjN3OG55KfxpTsP4WQe CHaBGsMhbKkv97dJYajVXkjnMjGtx6RE4iKFnYtC+qqUi6aVwXIt8tpMH/q3tFH4j8/E eReWg0pYIuoJS7Dt90LCh9/2TtvBXzIawIcGDNB8hWzREM4fL8u5+Io3ipOOFyg9d4H9 ciZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vav91eMb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6si18390122pfb.92.2019.01.28.08.03.33; Mon, 28 Jan 2019 08:03:50 -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=vav91eMb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731281AbfA1QCx (ORCPT + 99 others); Mon, 28 Jan 2019 11:02:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:48162 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729361AbfA1QCw (ORCPT ); Mon, 28 Jan 2019 11:02:52 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1187621852; Mon, 28 Jan 2019 16:02:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691371; bh=Swx/Wgnt/nrKoCx34LrA7E0gpVup2H/ktlG0cw8WvQY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vav91eMbhLxORuB+XQF4LRhQMYBW3ZJuaYheA7OcJeG0F/P6/QAvR85+k0v7XR0c8 HFmOHPIdHqvSqsZXkw2Q4qQLlYlXaqKFTtFvO/RbLb9wSkRlBesjuZtf1acztzY+RO alHiApcnVDwV/LmF5Gas8Zd/ehVHGGLMzBTtjSuY= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Andy Shevchenko , "Rafael J . Wysocki" , Sasha Levin , linux-acpi@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 070/258] ACPI: SPCR: Consider baud rate 0 as preconfigured state Date: Mon, 28 Jan 2019 10:56:16 -0500 Message-Id: <20190128155924.51521-70-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andy Shevchenko [ 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