Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1616816
| From | Andy Shevchenko <andy.shevchenko@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 1/2] serial: 8250: Add flag so drivers can avoid THRE probe |
| Date | 2017-04-05 12:40 +0200 |
| Message-ID | <tsQw2-1s1-23@gated-at.bofh.it> (permalink) |
| References | <tsKqB-62k-1@gated-at.bofh.it> <tsKqB-62k-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Apr 5, 2017 at 7:03 AM, Joel Stanley <joel@jms.id.au> wrote:
> The probing of THRE irq behaviour assumes the other end will be reading
> bytes out of the buffer in order to probe the port at driver init. In
> some cases the other end cannot be relied upon to read these bytes, so
> provide a flag for them to skip this step.
>
> Bit 16 was chosen as the flags are a int and the top bits are taken.
19 ?
>
> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Joel Stanley <joel@jms.id.au>
> ---
> drivers/tty/serial/8250/8250_port.c | 2 +-
> include/linux/serial_core.h | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
> index 6119516ef5fc..60a6c247340f 100644
> --- a/drivers/tty/serial/8250/8250_port.c
> +++ b/drivers/tty/serial/8250/8250_port.c
> @@ -2229,7 +2229,7 @@ int serial8250_do_startup(struct uart_port *port)
> }
> }
>
> - if (port->irq) {
> + if (port->irq && !(up->port.flags & UPF_NO_THRE_TEST)) {
> unsigned char iir1;
> /*
> * Test for UARTs that do not reassert THRE when the
> diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> index 58484fb35cc8..260245deec94 100644
> --- a/include/linux/serial_core.h
> +++ b/include/linux/serial_core.h
> @@ -195,6 +195,7 @@ struct uart_port {
> #define UPF_NO_TXEN_TEST ((__force upf_t) (1 << 15))
> #define UPF_MAGIC_MULTIPLIER ((__force upf_t) ASYNC_MAGIC_MULTIPLIER /* 16 */ )
>
> +#define UPF_NO_THRE_TEST ((__force upf_t) (1 << 19))
> /* Port has hardware-assisted h/w flow control */
> #define UPF_AUTO_CTS ((__force upf_t) (1 << 20))
> #define UPF_AUTO_RTS ((__force upf_t) (1 << 21))
> --
> 2.11.0
>
--
With Best Regards,
Andy Shevchenko
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 0/2] drivers: serial: Aspeed VUART driver Joel Stanley <joel@jms.id.au> - 2017-04-05 06:10 +0200
[PATCH v2 1/2] serial: 8250: Add flag so drivers can avoid THRE probe Joel Stanley <joel@jms.id.au> - 2017-04-05 06:10 +0200
Re: [PATCH v2 1/2] serial: 8250: Add flag so drivers can avoid THRE probe Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-04-05 12:40 +0200
[PATCH v2 2/2] drivers/serial: Add driver for Aspeed virtual UART Joel Stanley <joel@jms.id.au> - 2017-04-05 06:10 +0200
Re: [PATCH v2 2/2] drivers/serial: Add driver for Aspeed virtual UART Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-04-05 13:00 +0200
Re: [PATCH v2 2/2] drivers/serial: Add driver for Aspeed virtual UART Joel Stanley <joel@jms.id.au> - 2017-04-10 05:10 +0200
csiph-web