lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200129161955.30562-1-erosca@de.adit-jv.com>
Date:   Wed, 29 Jan 2020 17:19:55 +0100
From:   Eugeniu Rosca <erosca@...adit-jv.com>
To:     Geert Uytterhoeven <geert+renesas@...der.be>,
        <linux-serial@...r.kernel.org>, <linux-renesas-soc@...r.kernel.org>
CC:     Wolfram Sang <wsa+renesas@...g-engineering.com>,
        Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
        Ulrich Hecht <uli+renesas@...nd.eu>,
        "George G . Davis" <george_davis@...tor.com>,
        Andrew Gabbasov <andrew_gabbasov@...tor.com>,
        Jiada Wang <jiada_wang@...tor.com>,
        Yuichi Kusakabe <yuichi.kusakabe@...so-ten.com>,
        Yasushi Asano <yasano@...adit-jv.com>,
        <linux-kernel@...r.kernel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jslaby@...e.com>,
        Fukui Yohhei <yohhei.fukui@...so-ten.com>,
        Torii Kenichi <torii.ken1@...fujitsu.com>,
        Eugeniu Rosca <erosca@...adit-jv.com>
Subject: [PATCH] serial: sh-sci: Support custom speed setting

From: Torii Kenichi <torii.ken1@...fujitsu.com>

This patch is necessary to use BT module and XM module with DENSO TEN
development board.

This patch supports ASYNC_SPD_CUST flag by ioctl(TIOCSSERIAL), enables
custom speed setting with setserial(1).

The custom speed is calculated from uartclk and custom_divisor.
If custom_divisor is zero, custom speed setting is invalid.

Signed-off-by: Torii Kenichi <torii.ken1@...fujitsu.com>
[erosca: rebase against v5.5]
Signed-off-by: Eugeniu Rosca <erosca@...adit-jv.com>
---
 drivers/tty/serial/sh-sci.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 87ca6294de0e..dd468909b2c4 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -2405,6 +2405,10 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
 	if (!baud)
 		goto done;
 
+	if (baud == 38400 && (port->flags & UPF_SPD_MASK) == UPF_SPD_CUST &&
+	    port->custom_divisor)
+		baud = port->uartclk / port->custom_divisor;
+
 	/*
 	 * There can be multiple sources for the sampling clock.  Find the one
 	 * that gives us the smallest deviation from the desired baud rate.
-- 
2.25.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ