This is a note to let you know that I've just added the patch titled

    tty/serial: at91: RS485 mode: 0 is valid for delay_rts_after_send

to the 4.1-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     tty-serial-at91-rs485-mode-0-is-valid-for-delay_rts_after_send.patch
and it can be found in the queue-4.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 8687634b7908c42eb700e0469e110e02833611d1 Mon Sep 17 00:00:00 2001
From: Nicolas Ferre <[email protected]>
Date: Mon, 11 May 2015 13:00:31 +0200
Subject: tty/serial: at91: RS485 mode: 0 is valid for delay_rts_after_send
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From: Nicolas Ferre <[email protected]>

commit 8687634b7908c42eb700e0469e110e02833611d1 upstream.

In RS485 mode, we may want to set the delay_rts_after_send value to 0.
In the datasheet, the 0 value is said to "disable" the Transmitter Timeguard but
this is exactly the expected behavior if we want no delay...

Moreover, if the value was set to non-zero value by device-tree or earlier
ioctl command, it was impossible to change it back to zero.

Reported-by: Sami Pietikäinen <[email protected]>
Signed-off-by: Nicolas Ferre <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/tty/serial/atmel_serial.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -315,8 +315,7 @@ static int atmel_config_rs485(struct uar
        if (rs485conf->flags & SER_RS485_ENABLED) {
                dev_dbg(port->dev, "Setting UART to RS485\n");
                atmel_port->tx_done_mask = ATMEL_US_TXEMPTY;
-               if ((rs485conf->delay_rts_after_send) > 0)
-                       UART_PUT_TTGR(port, rs485conf->delay_rts_after_send);
+               UART_PUT_TTGR(port, rs485conf->delay_rts_after_send);
                mode |= ATMEL_US_USMODE_RS485;
        } else {
                dev_dbg(port->dev, "Setting UART to RS232\n");
@@ -354,8 +353,7 @@ static void atmel_set_mctrl(struct uart_
 
        /* override mode to RS485 if needed, otherwise keep the current mode */
        if (port->rs485.flags & SER_RS485_ENABLED) {
-               if ((port->rs485.delay_rts_after_send) > 0)
-                       UART_PUT_TTGR(port, port->rs485.delay_rts_after_send);
+               UART_PUT_TTGR(port, port->rs485.delay_rts_after_send);
                mode &= ~ATMEL_US_USMODE;
                mode |= ATMEL_US_USMODE_RS485;
        }
@@ -2061,8 +2059,7 @@ static void atmel_set_termios(struct uar
 
        /* mode */
        if (port->rs485.flags & SER_RS485_ENABLED) {
-               if ((port->rs485.delay_rts_after_send) > 0)
-                       UART_PUT_TTGR(port, port->rs485.delay_rts_after_send);
+               UART_PUT_TTGR(port, port->rs485.delay_rts_after_send);
                mode |= ATMEL_US_USMODE_RS485;
        } else if (termios->c_cflag & CRTSCTS) {
                /* RS232 with hardware handshake (RTS/CTS) */


Patches currently in stable-queue which might be from [email protected] 
are

queue-4.1/arm-at91-dt-sama5d4ek-mci0-uses-slot-0.patch
queue-4.1/iio-adc-at91_adc-allow-to-use-full-range-of-startup-time.patch
queue-4.1/tty-serial-at91-rs485-mode-0-is-valid-for-delay_rts_after_send.patch
queue-4.1/arm-at91-dt-trivial-fix-usb-udc-compatible-string.patch
queue-4.1/arm-at91-dt-update-udc-compatible-strings.patch
queue-4.1/arm-at91-dt-sama5d4-fix-dma-conf-for-aes-sha-and-tdes-nodes.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to