]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/tty/serial/8250/8250_core.c
serial: uart: add hw flow control support configuration
[mirror_ubuntu-artful-kernel.git] / drivers / tty / serial / 8250 / 8250_core.c
index 111ee8acb07ea437cb145d3a43f48c94d11a2494..65556fc57d5606259d343f458d367e50660f8f1d 100644 (file)
@@ -2333,9 +2333,11 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
         * the trigger, or the MCR RTS bit is cleared.  In the case where
         * the remote UART is not using CTS auto flow control, we must
         * have sufficient FIFO entries for the latency of the remote
-        * UART to respond.  IOW, at least 32 bytes of FIFO.
+        * UART to respond.  IOW, at least 32 bytes of FIFO. Also enable
+        * AFE if hw flow control is supported
         */
-       if (up->capabilities & UART_CAP_AFE && port->fifosize >= 32) {
+       if ((up->capabilities & UART_CAP_AFE && (port->fifosize >= 32)) ||
+           (port->flags & UPF_HARD_FLOW)) {
                up->mcr &= ~UART_MCR_AFE;
                if (termios->c_cflag & CRTSCTS)
                        up->mcr |= UART_MCR_AFE;