mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: "Pali Rohár" <pali@kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	"Allen Yan" <yanwei@marvell.com>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Gregory CLEMENT" <gregory.clement@bootlin.com>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: [PATCH] serial: mvebu: Apply old baudrate to termios
Date: Tue, 28 Jun 2022 12:41:55 +0300	[thread overview]
Message-ID: <20220628094155.26297-1-ilpo.jarvinen@linux.intel.com> (raw)

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 <ilpo.jarvinen@linux.intel.com>

---
 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)

             reply	other threads:[~2022-06-28  9:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28  9:41 Ilpo Järvinen [this message]
2022-06-28  9:51 ` Pali Rohár
2022-06-28  9:59   ` Pali Rohár
2022-06-28 11:39     ` Andy Shevchenko
2022-06-28 11:40       ` Andy Shevchenko
2022-06-30  8:28         ` Pali Rohár

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220628094155.26297-1-ilpo.jarvinen@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gregory.clement@bootlin.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=pali@kernel.org \
    --cc=yanwei@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®