Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3208016pxb; Mon, 9 Nov 2020 05:37:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxeXDk+CSDQRvQYx2WuLYAItCcwrzCkp9fMN627N6sCLV0BqwdNGxwIxB4hIekP6zfLbWvF X-Received: by 2002:a17:906:c206:: with SMTP id d6mr14413153ejz.239.1604929054990; Mon, 09 Nov 2020 05:37:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604929054; cv=none; d=google.com; s=arc-20160816; b=EZ88z8ncy1tpIFXEqv89Bllr/GCuLpuVnbmSTFPjLDtqxB1T8+bzQZ1oh0/pmFDabd 88mA+S0NgSexuWfmKy0C3LNmItBvrRXezElJgmHl/FCw7NwzQQ+HBPNaQf+/AvPJ30bi 5JwVz+RS3qiOJnUNDFNsOlpOtNIpldpyj+M5o02krDo/wHu9rAi1NeYFktZEWum2lYDL +WQIjzJQwYW/+MZ0ti3O61CyYysLXtldUPuZ3f1NbuUOVxoZABfr+oLLRFj1KzxmWBHc 6g4d8nhNAorGUbqxUgUjuM4Prg9uYtQjPYM4hvlPZcTtv5Q3rw6UsEgc8CklB6zLVe1Q r9YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7/Zh+jwMhUzq92YKZ5RP6/eyIMibSC9HfjLF2xzgVrM=; b=OTU+i3EAfbEgoxAghIY4/268zkwiff2+WnTQpwpJFCYWga3AxWr98g2OiA1vsZSa4F 5j6oLM/F7xEVfP4FFkufYILFGDhRy0oWxj1swcGxe1vg5b3vQK//hRf1UNDpUvYOn05F JHmNr47j92eKqTc2OsFyR/9uMikf1Qb03RTQXtpnKIYxtutFh3Q2eVJCeBTuS/o6g7+c n08xtqSoVepQvrpU8mLeWnV4N4RmpKFJz7nRulqFo7ufCgoKwZ2PTExqtnlVRltf7JR7 wI90M8XfCwlEhidlCc1bo9ppkRXSIdXpVtSAH87ETmQBWPq3+gRN5FAGWFcYLTWjwSNr Nb6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RFs1Haie; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jx9si2212449ejb.371.2020.11.09.05.37.12; Mon, 09 Nov 2020 05:37:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RFs1Haie; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733015AbgKINfz (ORCPT + 99 others); Mon, 9 Nov 2020 08:35:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:58020 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730777AbgKINFU (ORCPT ); Mon, 9 Nov 2020 08:05:20 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 0223720663; Mon, 9 Nov 2020 13:05:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604927102; bh=0LisRcsaOQwUHAi14yXqT89DRf0dyrFbssm8tp7AO6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RFs1HaietzSJYzE3ZTarkR6qKAJl5TfJOVNvGgXI9e/4NjhJb6Y7R1oNOPmoWI3p5 2QDY7d3QFOpNgg6mAtTfRa9fz+3Iyw8wY2kDAoCFV3LpbCLsqlpvmZIxRHfmJKZ7Yw 4ttfYR8DoCYxQB3sw5vqedFx7Y3L2MOj7W32M8wI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Claire Chang Subject: [PATCH 4.9 110/117] serial: 8250_mtk: Fix uart_get_baud_rate warning Date: Mon, 9 Nov 2020 13:55:36 +0100 Message-Id: <20201109125030.920095810@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125025.630721781@linuxfoundation.org> References: <20201109125025.630721781@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Claire Chang commit 912ab37c798770f21b182d656937072b58553378 upstream. Mediatek 8250 port supports speed higher than uartclk / 16. If the baud rates in both the new and the old termios setting are higher than uartclk / 16, the WARN_ON in uart_get_baud_rate() will be triggered. Passing NULL as the old termios so uart_get_baud_rate() will use uartclk / 16 - 1 as the new baud rate which will be replaced by the original baud rate later by tty_termios_encode_baud_rate() in mtk8250_set_termios(). Fixes: 551e553f0d4a ("serial: 8250_mtk: Fix high-speed baud rates clamping") Signed-off-by: Claire Chang Link: https://lore.kernel.org/r/20201102120749.374458-1-tientzu@chromium.org Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_mtk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/tty/serial/8250/8250_mtk.c +++ b/drivers/tty/serial/8250/8250_mtk.c @@ -56,7 +56,7 @@ mtk8250_set_termios(struct uart_port *po */ baud = tty_termios_baud_rate(termios); - serial8250_do_set_termios(port, termios, old); + serial8250_do_set_termios(port, termios, NULL); tty_termios_encode_baud_rate(termios, baud, baud);