linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org,
	jslaby@suse.com, michal.simek@xilinx.com,
	linux-kernel@vger.kernel.org,
	Raviteja Narayanam <raviteja.narayanam@xilinx.com>
Subject: Re: [PATCH v3] serial: uartps: Add TACTIVE bit in cdns_uart_tx_empty function
Date: Fri, 31 Jan 2020 15:18:36 +0100	[thread overview]
Message-ID: <20200131141836.GG10381@localhost> (raw)
In-Reply-To: <1580468685-11373-1-git-send-email-shubhrajyoti.datta@xilinx.com>

On Fri, Jan 31, 2020 at 04:34:45PM +0530, Shubhrajyoti Datta wrote:
> From: Raviteja Narayanam <raviteja.narayanam@xilinx.com>
> 
> Make sure that all the bytes are transmitted out of Uart by monitoring
> TACTIVE bit as well.
> Before setting up baud rate in set termios function, do not wait for
> Tx empty as it is taken care by the tty layer if user specified.

Since this is two logical changes I suggest you split it in two patches;
the first removing the wait from set_termios, and the second adding the
TCACTIVE check.

> Signed-off-by: Raviteja Narayanam <raviteja.narayanam@xilinx.com>
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
> ---
> v3:
> removed the wait from the set_termios and added the TACTIVE to cdns_uart_tx_empty
> As suggested by Johan.
> 
>  drivers/tty/serial/xilinx_uartps.c | 22 +++++-----------------
>  1 file changed, 5 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
> index ed2f325..ebd0a74 100644
> --- a/drivers/tty/serial/xilinx_uartps.c
> +++ b/drivers/tty/serial/xilinx_uartps.c
> @@ -32,7 +32,6 @@
>  #define CDNS_UART_NAME		"xuartps"
>  #define CDNS_UART_FIFO_SIZE	64	/* FIFO size */
>  #define CDNS_UART_REGISTER_SPACE	0x1000
> -#define TX_TIMEOUT		500000
>  
>  /* Rx Trigger level */
>  static int rx_trigger_level = 56;
> @@ -656,8 +655,9 @@ static unsigned int cdns_uart_tx_empty(struct uart_port *port)
>  {
>  	unsigned int status;
>  
> -	status = readl(port->membase + CDNS_UART_SR) &
> -				CDNS_UART_SR_TXEMPTY;
> +	status = ((readl(port->membase + CDNS_UART_SR) &
> +				(CDNS_UART_SR_TXEMPTY |
> +				CDNS_UART_SR_TACTIVE)) == CDNS_UART_SR_TXEMPTY);
>  	return status ? TIOCSER_TEMT : 0;

Please rewrite this to avoid some of the line breaks (e.g. split readl()
from the test).

Johan

  reply	other threads:[~2020-01-31 14:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-31 11:04 [PATCH v3] serial: uartps: Add TACTIVE bit in cdns_uart_tx_empty function Shubhrajyoti Datta
2020-01-31 14:18 ` Johan Hovold [this message]
2020-02-01 11:29 ` Maarten Brock

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=20200131141836.GG10381@localhost \
    --to=johan@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=raviteja.narayanam@xilinx.com \
    --cc=shubhrajyoti.datta@xilinx.com \
    /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).