All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-aspeed@lists.ozlabs.org
Subject: [PATCH 1/5] serial: Introduce UPSTAT_SYNC_FIFO for synchronised FIFOs
Date: Fri, 23 Mar 2018 16:33:50 +0100	[thread overview]
Message-ID: <20180323153350.GC25972@kroah.com> (raw)
In-Reply-To: <20180321025241.19785-2-jk@ozlabs.org>

On Wed, Mar 21, 2018 at 10:52:37AM +0800, Jeremy Kerr wrote:
> This change adds a flag to indicate that a UART is has an external means
> of synchronising its FIFO, without needing CTSRTS or XON/XOFF.
> 
> This allows us to use the throttle/unthrottle callbacks, without having
> to claim other methods of flow control.
> 
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
> ---
>  drivers/tty/serial/serial_core.c | 4 ++--
>  include/linux/serial_core.h      | 1 +
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> index f534a40aebde..8f3dfc8b5307 100644
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -678,7 +678,7 @@ static void uart_throttle(struct tty_struct *tty)
>  	if (C_CRTSCTS(tty))
>  		mask |= UPSTAT_AUTORTS;
>  
> -	if (port->status & mask) {
> +	if (port->status & (mask | UPSTAT_SYNC_FIFO)) {
>  		port->ops->throttle(port);
>  		mask &= ~port->status;
>  	}

Why not just set mask to UPSTAT_SYNC_FIFO at the top of this function?

> @@ -707,7 +707,7 @@ static void uart_unthrottle(struct tty_struct *tty)
>  	if (C_CRTSCTS(tty))
>  		mask |= UPSTAT_AUTORTS;
>  
> -	if (port->status & mask) {
> +	if (port->status & (mask | UPSTAT_SYNC_FIFO)) {
>  		port->ops->unthrottle(port);
>  		mask &= ~port->status;
>  	}

Same here.  Would make it a bit more obvious (at least to me...)

thanks,

greg k-h

WARNING: multiple messages have this Message-ID (diff)
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Jeremy Kerr <jk@ozlabs.org>
Cc: linux-serial@vger.kernel.org, linux-aspeed@lists.ozlabs.org,
	openbmc@lists.ozlabs.org, Joel Stanley <joel@jms.id.au>,
	Andrew Jeffery <andrew@aj.id.au>, Jiri Slaby <jslaby@suse.com>
Subject: Re: [PATCH 1/5] serial: Introduce UPSTAT_SYNC_FIFO for synchronised FIFOs
Date: Fri, 23 Mar 2018 16:33:50 +0100	[thread overview]
Message-ID: <20180323153350.GC25972@kroah.com> (raw)
In-Reply-To: <20180321025241.19785-2-jk@ozlabs.org>

On Wed, Mar 21, 2018 at 10:52:37AM +0800, Jeremy Kerr wrote:
> This change adds a flag to indicate that a UART is has an external means
> of synchronising its FIFO, without needing CTSRTS or XON/XOFF.
> 
> This allows us to use the throttle/unthrottle callbacks, without having
> to claim other methods of flow control.
> 
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
> ---
>  drivers/tty/serial/serial_core.c | 4 ++--
>  include/linux/serial_core.h      | 1 +
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> index f534a40aebde..8f3dfc8b5307 100644
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -678,7 +678,7 @@ static void uart_throttle(struct tty_struct *tty)
>  	if (C_CRTSCTS(tty))
>  		mask |= UPSTAT_AUTORTS;
>  
> -	if (port->status & mask) {
> +	if (port->status & (mask | UPSTAT_SYNC_FIFO)) {
>  		port->ops->throttle(port);
>  		mask &= ~port->status;
>  	}

Why not just set mask to UPSTAT_SYNC_FIFO at the top of this function?

> @@ -707,7 +707,7 @@ static void uart_unthrottle(struct tty_struct *tty)
>  	if (C_CRTSCTS(tty))
>  		mask |= UPSTAT_AUTORTS;
>  
> -	if (port->status & mask) {
> +	if (port->status & (mask | UPSTAT_SYNC_FIFO)) {
>  		port->ops->unthrottle(port);
>  		mask &= ~port->status;
>  	}

Same here.  Would make it a bit more obvious (at least to me...)

thanks,

greg k-h

  reply	other threads:[~2018-03-23 15:33 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-21  2:52 [PATCH 0/5] serial: implement flow control for ASPEED VUART driver Jeremy Kerr
2018-03-21  2:52 ` Jeremy Kerr
2018-03-21  2:52 ` [PATCH 1/5] serial: Introduce UPSTAT_SYNC_FIFO for synchronised FIFOs Jeremy Kerr
2018-03-21  2:52   ` Jeremy Kerr
2018-03-23 15:33   ` Greg Kroah-Hartman [this message]
2018-03-23 15:33     ` Greg Kroah-Hartman
2018-03-27  1:38     ` Jeremy Kerr
2018-03-27  1:38       ` Jeremy Kerr
2018-03-23 15:50   ` Eddie James
2018-03-23 15:50     ` Eddie James
2018-03-21  2:52 ` [PATCH 2/5] serial: expose buf_overrun count through proc interface Jeremy Kerr
2018-03-21  2:52   ` Jeremy Kerr
2018-03-23 15:29   ` Greg Kroah-Hartman
2018-03-23 15:29     ` Greg Kroah-Hartman
2018-03-27  1:44     ` Jeremy Kerr
2018-03-27  1:44       ` Jeremy Kerr
2018-03-23 15:50   ` Eddie James
2018-03-23 15:50     ` Eddie James
2018-03-21  2:52 ` [PATCH 3/5] serial/8250: export serial8250_read_char Jeremy Kerr
2018-03-21  2:52   ` Jeremy Kerr
2018-03-23 15:51   ` Eddie James
2018-03-23 15:51     ` Eddie James
2018-03-21  2:52 ` [PATCH 4/5] serial/aspeed-vuart: Implement rx throttling Jeremy Kerr
2018-03-21  2:52   ` Jeremy Kerr
2018-03-23 15:51   ` Eddie James
2018-03-23 15:51     ` Eddie James
2018-03-21  2:52 ` [PATCH 5/5] serial/aspeed-vuart: Implement quick throttle mechanism Jeremy Kerr
2018-03-21  2:52   ` Jeremy Kerr
2018-03-21  3:26   ` Joel Stanley
2018-03-21  3:26     ` Joel Stanley
2018-03-21  3:32     ` Jeremy Kerr
2018-03-21  3:32       ` Jeremy Kerr
2018-03-21  3:57   ` Jeremy Kerr
2018-03-21  3:57     ` Jeremy Kerr
2018-03-21  4:36   ` [PATCH v2 " Jeremy Kerr
2018-03-21  4:36     ` Jeremy Kerr
2018-03-23 15:51   ` [PATCH " Eddie James
2018-03-23 15:51     ` Eddie James
2018-03-23 15:51 ` [PATCH 0/5] serial: implement flow control for ASPEED VUART driver Greg Kroah-Hartman
2018-03-23 15:51   ` Greg Kroah-Hartman
2018-03-27  3:38   ` Jeremy Kerr
2018-03-27  3:38     ` Jeremy Kerr
2018-03-27  3:48   ` [PATCH v2 0/4] " Jeremy Kerr
2018-03-27  3:48     ` Jeremy Kerr
2018-03-27  3:48     ` [PATCH v2 1/4] serial: Introduce UPSTAT_SYNC_FIFO for synchronised FIFOs Jeremy Kerr
2018-03-27  3:48       ` Jeremy Kerr
2018-03-27  3:48     ` [PATCH v2 2/4] serial/8250: export serial8250_read_char Jeremy Kerr
2018-03-27  3:48       ` Jeremy Kerr
2018-03-27  3:48     ` [PATCH v2 3/4] serial/aspeed-vuart: Implement rx throttling Jeremy Kerr
2018-03-27  3:48       ` Jeremy Kerr
2018-03-27  3:48     ` [PATCH v2 4/4] serial/aspeed-vuart: Implement quick throttle mechanism Jeremy Kerr
2018-03-27  3:48       ` Jeremy Kerr
2018-03-27  6:52     ` [PATCH v2 0/4] serial: implement flow control for ASPEED VUART driver Joel Stanley
2018-03-27  6:52       ` Joel Stanley

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=20180323153350.GC25972@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-aspeed@lists.ozlabs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.