Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3787026iog; Tue, 28 Jun 2022 02:47:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v61OlE12g7CiKSTnlIM+rqaalGjqHcLSL5ZpJbyiMSxydLE+dtioonq+o4buActqF+vcwi X-Received: by 2002:a17:90a:cc7:b0:1ea:3993:78f9 with SMTP id 7-20020a17090a0cc700b001ea399378f9mr26322277pjt.179.1656409669647; Tue, 28 Jun 2022 02:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656409669; cv=none; d=google.com; s=arc-20160816; b=DVQ2lkzyjYbvL+UY6/4yiDnBlptl1uaVFJYaN+2Wnb8rXXcVPBYB3Y1sJhzWSOsgKX 75zk+QMq8jMxFHJIoG+DnhXYCLVi/PUhyJ1ZgezNHSGGsKbn1HYlPqA1V1vEzkEKTAYe whr9XQ9eBEUhbgz7J8+qs7UbHAnhvp2P4oLGlp5oHGa8DiN3ijKTu9tN3zxUOXfTu1pa ibC1zxHXrsjWx2D43kxdCFjEQr/PTEsiHyF2CG+mXEd5GpfkqAchAUuJQr12NZWdnwO3 nHoL6zJolfux80JqsylrGSK1DP3VKfg68l76MzOX35HcRi9gcBHLpO2DpMjHuP8I8xDp ItaA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=27oH3p2p3RqE5bnY9h/2wTRGLTMJYsO2+xIYMwkreKk=; b=V4xRThyr/qt5PG0yhWu1FeesrzuGpD/xkIxSt3moWSoS1Xp8MHXUa2VOUtJIPV0lYE Ee18yUbHm0RH6C0u/MA5P45mA+/VJcpyKjV4mQeuBBUKPRnorMvxFt3rVOjOp0kslmkS 0rhC16KfXR8WGfPiCjGpgWp9PRVWnNMijBdAy8l4jFgicrwPXxALN4VXDiSYAoAZWtwV 0Jvxocy8nuFnb7TLXKcOZ1ObMRHG9lPS4cQlYnCju5Xh8t80gTLSyUcfA3ak2kN/g5ak KYgBdIkUBUdcfBvCuSZakVxjBSk/TwRZhFM2AKyy5ffs/PNcakCtatn3A7pHnjqKCa5M 03uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=E3mPT6LV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p2-20020a17090a930200b001d2865c095fsi16716280pjo.61.2022.06.28.02.47.36; Tue, 28 Jun 2022 02:47:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=E3mPT6LV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343958AbiF1JmH (ORCPT + 99 others); Tue, 28 Jun 2022 05:42:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241029AbiF1JmG (ORCPT ); Tue, 28 Jun 2022 05:42:06 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2291252BD; Tue, 28 Jun 2022 02:42:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656409326; x=1687945326; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=JsMXjIg8C9OG1eayahYeUAeX1A9gxni645x5KsPj9vw=; b=E3mPT6LVbiDohjed0sCnpwf/keG/AbIEi365/ktd3Kbi6vfdg/uAUQNM FzkjtFZ7gl6hyGzTMgKMnhEtalv3dgipO7yjQlZnGIpBYktV0Pkwe7fQR zJm4En0Y90d7HR4PGyGwpftHUlfNsF4pTe1wHRZO5CKXPVS7pwrpThGcH XY80jXNQ7rDoCYfJMB4kHlxKB6ENp2jFtGpvGa/M403HdWAvS5KPxLX3C aVxPpmrY5cO2LEzTrp0ntwUxexdex+ittwNOPHCrj6ZKW8Ext30ygXSqE ZjQqlIwJpSWAFQSxzWYcHybzqvMuRIQFulqBc45poa2uQPxJ3+lbUjMAl g==; X-IronPort-AV: E=McAfee;i="6400,9594,10391"; a="282428984" X-IronPort-AV: E=Sophos;i="5.92,227,1650956400"; d="scan'208";a="282428984" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2022 02:42:05 -0700 X-IronPort-AV: E=Sophos;i="5.92,227,1650956400"; d="scan'208";a="646843688" Received: from iannetti-mobl.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.251.216.215]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2022 02:42:02 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: =?UTF-8?q?Pali=20Roh=C3=A1r?= , Greg Kroah-Hartman , Jiri Slaby , Allen Yan , Miquel Raynal , Gregory CLEMENT , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH] serial: mvebu: Apply old baudrate to termios Date: Tue, 28 Jun 2022 12:41:55 +0300 Message-Id: <20220628094155.26297-1-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A fallback baud rate was derived from old termios but got never applied to (new/current) termios. Old termios is dropped once ->set_termios() call chain completes, only termios persists the values. Encode also the old baud rate into termios. Fixes: 68a0db1d7da2 ("serial: mvebu-uart: add function to change baudrate") Signed-off-by: Ilpo Järvinen --- drivers/tty/serial/mvebu-uart.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c index 0429c2a54290..12a79018697f 100644 --- a/drivers/tty/serial/mvebu-uart.c +++ b/drivers/tty/serial/mvebu-uart.c @@ -592,10 +592,9 @@ static void mvebu_uart_set_termios(struct uart_port *port, if (old) baud = uart_get_baud_rate(port, old, NULL, min_baud, max_baud); - } else { - tty_termios_encode_baud_rate(termios, baud, baud); - uart_update_timeout(port, termios->c_cflag, baud); } + tty_termios_encode_baud_rate(termios, baud, baud); + uart_update_timeout(port, termios->c_cflag, baud); /* Only the following flag changes are supported */ if (old) { -- tg: (f287f971e256..) fix/mvebu-apply-old-baud (depends on: tty-next)