Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3201253pxb; Mon, 9 Nov 2020 05:28:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJztJXIBz5UvJuzGYFgvrA8RLgN9Sjo+1ooCfz4Xj1wZLWRV9lhTKgSh0Y7DLfucg7IH7v72 X-Received: by 2002:a50:9993:: with SMTP id m19mr14853933edb.99.1604928500505; Mon, 09 Nov 2020 05:28:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604928500; cv=none; d=google.com; s=arc-20160816; b=pm28PYjnN3lP1dm7bhcsVMMEyJHzQcaYr2QuPd6nKcwvHjFlI2xBajt73mt86lK0If dV8Ja9nySG7XJ0YOLwQQ8M/8djiBYUOD3PPVIkd4mXFQ0Qa/OlabiEVWQ7tlCGxpVtL5 WgtbH3rlmGGhg7hacG3veA7t4N4Z9ppoFD1xHyfBEXt4Y3xOhkZy1lEG++PmpYvGqnyl 0rEuy13zdhyV/HMr+HmOhh/PHKx3ZbM27f53hXb8xUwsbiHnSYaUtEmPB/kR3AmhwMy9 YjgnAwA4i/yUglwCyNI6ollsSmLQlSHL7/Pmo7XiwHNWQDfnw4iE4L/hB95uMNdkB2yu gAxg== 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=F1RrRIWNbTmPstC+/I0fdW07e8kERI9MxtaPi5WBJoU=; b=UjduyVJL+SjxnWayer6tZnCAs1V5k0cNK6FJoWw0Z+cbjgg7KO/cgvCuFtPLt7B1q8 Hfonyz5/5I3AbNDZL+GwbLvv/TzoXyB7miGpVEvZibhgwlseq0lVhvXkFp6BC0v6tUjs 1cupYgQlX8s59PCpwVwwWyG532eQo2xZK8OSp4NNR93LJe+5q00eCN/lGAuGoZZmhmuV WEmt2bps3rT2/bND9wB9N9oWgEAj4oHX0YFJ6cqld6OJn/s52NyZ5K7/285+5H+wmLON 7V3Ahbh/OUNvKrGR8Q2opCDVN7PtmL0W9kzCzOd7aeIQyS8T4wQaVZOVWcO8w9RzTwdX iGbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=y3yKlGQu; 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 s25si6688469ejv.48.2020.11.09.05.27.57; Mon, 09 Nov 2020 05:28:20 -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=y3yKlGQu; 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 S1732699AbgKINPq (ORCPT + 99 others); Mon, 9 Nov 2020 08:15:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:42498 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732621AbgKINPi (ORCPT ); Mon, 9 Nov 2020 08:15:38 -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 494A620789; Mon, 9 Nov 2020 13:15:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604927738; bh=QilPlO8TlXCWBssvIMNxN/mCxzVidglzw5xTE28rmcg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y3yKlGQu9Xa/rplYzJLkMNLRHCIXGGdKspUtcq+TQ/Dif+NSEE4ei+Y1EVqSnlwJg 3dnTGzJyikODF+tvRmgfq878H+b1BKghaITj5RIEJNkV5WLw3iLX2N8sgS1wLGs8Sj cCJC2z7Sn2X7vRj/LaHdtzI3txb+kdpBHpFM5xE8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Claire Chang Subject: [PATCH 5.4 67/85] serial: 8250_mtk: Fix uart_get_baud_rate warning Date: Mon, 9 Nov 2020 13:56:04 +0100 Message-Id: <20201109125025.791456479@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125022.614792961@linuxfoundation.org> References: <20201109125022.614792961@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 @@ -316,7 +316,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);