Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3197436pxb; Mon, 9 Nov 2020 05:22:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJxU1Ipan7pVdFEGlStZTPpxPTO7TLm/KEB1+dyr1AA4BonSubdlEfViNH2OvehiapYJRPBF X-Received: by 2002:a17:906:4698:: with SMTP id a24mr15668130ejr.90.1604928169200; Mon, 09 Nov 2020 05:22:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604928169; cv=none; d=google.com; s=arc-20160816; b=0c/uEKOIgGzlary6th3OWE4tIJqmlRYmZzJEppSk/zl8++JPpsb8eTHExKBumjl6bK uK9x56TEZewUX9P1WDq/6km5IWaMcTlBcbE7pJxFbCQGokjHnAYNQuCILDaVTNFvJf8P r6XgumGLOo+WvCJSNyRCjeeOP0VuBjYKWcNEC5BGL8QnFXmjhPgHA75U1EYMzUQJhfxb f9ov44u5qRGW/VaoxqE2IWYgzNHh3vWdO0RzVKhfo1IRLTNeKX0Z0kks8QRB+lic1znu jPy5mfyKUP46oEQwi46ORe3wub9xt7qSldQ7mDbO3tTeuS2eV0tAvrfVK7804MZcXPww eq/w== 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=HA15sun53upVkupX1VSswPlETdx7KCUC1ZHC5S6FaGU=; b=KiRHKNgESID1JVgqe2v3OkQyjeSWqRfKHVwnXk+7AjiFXL/+7WcguE0ehYpqVQ2i2M JvuhD5Xc2dnaRYW+fF+YPZSWWMU0USTTTWh+isIMUg5sFiMOsePviwL4JU14GyUskIxd gWo2Uw+AkURPmlDxnbqrASNRTIrvjpnSKhiVzHS+PMPz02sfeIQVfKVNPsq3zgm6Sa3M 0xHoH/siaFAec8z/0d6eG4z4Av53vP2fOmSQOUzVwY2PEjl3kT8+fW+e80qtoXKbguGj z+tejPJqX8tSdjadP5gGhG12HbGypQNKF7wjtwBqo88rtY55Z1KDxGPdayY07HfX2diV 2UlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1gsfy8Up; 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 q3si7074789edv.85.2020.11.09.05.22.25; Mon, 09 Nov 2020 05:22:49 -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=1gsfy8Up; 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 S2388021AbgKINVK (ORCPT + 99 others); Mon, 9 Nov 2020 08:21:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:48826 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388016AbgKINVG (ORCPT ); Mon, 9 Nov 2020 08:21:06 -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 E526B2076E; Mon, 9 Nov 2020 13:21:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604928065; bh=09Gh9YBp1iWL0yx1aqmdbXmYWJb/gHDnh6epx6VqfIQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1gsfy8UpUgurDAzYQK3eLknKHXCqDGKqVr5n4rH+4NjirsrYpJUMiMCIMXngcdxBo N7ke4khXLc8UF+CnzxwUtZjiUvf4j5x8849jRb2MDWNuOhKEChCvCcU//YxA/55SkP z+V9H7LkHodHEOG82DJxDQLzy96DVppxiLmq6xs4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Claire Chang Subject: [PATCH 5.9 115/133] serial: 8250_mtk: Fix uart_get_baud_rate warning Date: Mon, 9 Nov 2020 13:56:17 +0100 Message-Id: <20201109125036.221818276@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125030.706496283@linuxfoundation.org> References: <20201109125030.706496283@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 @@ -317,7 +317,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);