linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Denis Ahrens <denis@h3q.com>
Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org
Subject: Re: [PATCH] 16C950 UART enable Hardware Flow Control
Date: Mon, 25 May 2020 10:27:50 +0200	[thread overview]
Message-ID: <20200525082750.GB5276@localhost> (raw)
In-Reply-To: <BACA4F76-3D51-4854-894B-2E69272B5676@h3q.com>

On Sun, May 24, 2020 at 06:31:44PM +0200, Denis Ahrens wrote:
> From: Denis Ahrens <denis@h3q.com>
> 
> Enable Automatic RTS/CTS flow control for the 16C950 UART in Enhanced Mode
> like described in the Data Sheet Revision 1.2 page 28 and 29.
> 
> Without this change normal console output works, but everything putting
> a little more pressure on the UART simply overruns the FIFO.
> 
> Signed-off-by: Denis Ahrens <denis@h3q.com>
> ---
> 
> diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
> index f77bf820b7a3..024235946f4d 100644
> --- a/drivers/tty/serial/8250/8250_port.c
> +++ b/drivers/tty/serial/8250/8250_port.c
> @@ -2168,7 +2168,9 @@ int serial8250_do_startup(struct uart_port *port)
>                 serial_port_out(port, UART_LCR, 0);
>                 serial_icr_write(up, UART_CSR, 0); /* Reset the UART */
>                 serial_port_out(port, UART_LCR, UART_LCR_CONF_MODE_B);
> -               serial_port_out(port, UART_EFR, UART_EFR_ECB);
> +               serial_port_out(port, UART_EFR, UART_EFR_ECB |
> +                                               UART_EFR_RTS |
> +                                               UART_EFR_CTS);
>                 serial_port_out(port, UART_LCR, 0);
>         }

This doesn't look right as you're now enabling automatic flow control
for everyone.

Try adding this to set_termios() instead when enabling flow control.

Also your patch has had all tabs turned into spaces. You may need to fix
your mail setup. Try sending the patch to yourself first and make sure
you can apply it (also take a look at git-send-email).

Johan

  reply	other threads:[~2020-05-25  8:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-24 16:31 [PATCH] 16C950 UART enable Hardware Flow Control Denis Ahrens
2020-05-25  8:27 ` Johan Hovold [this message]
2020-05-25 17:49   ` Denis Ahrens
2020-05-27  7:55     ` Johan Hovold
2020-05-28 12:06       ` Pavel Machek
2020-05-27 20:49 Denis Ahrens

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=20200525082750.GB5276@localhost \
    --to=johan@kernel.org \
    --cc=denis@h3q.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-serial@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).