All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
To: Ulrich Hecht <uli+renesas@fpond.eu>
Cc: "wsa@kernel.org" <wsa@kernel.org>,
	"geert@linux-m68k.org" <geert@linux-m68k.org>,
	"linux-renesas-soc@vger.kernel.org" 
	<linux-renesas-soc@vger.kernel.org>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>
Subject: RE: [PATCH] serial: sh-sci: correct units in comment about DMA timeout
Date: Fri, 9 Apr 2021 12:16:13 +0000	[thread overview]
Message-ID: <OSAPR01MB3683F5855937833872F4FE23D8739@OSAPR01MB3683.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <20210409082524.3480-1-uli+renesas@fpond.eu>

Hi Ulrich-san,

Thank you for the patch!

> From: Ulrich Hecht, Sent: Friday, April 9, 2021 5:25 PM
> 
> Since the transition to hrtimers, the calculation does not involve jiffies
> any longer, which has led to confusion. State the times in ms instead.

IIUC, the unit of rx_timeout was changed from milliseconds to microseconds
when hrtimer is used. So, almost all comments was not needed.

Also, I'm wondering if the following condition is not needed or not.
This is because this was "20ms". But, perhaps, the driver will not
set rx_timeout to "20us" or small.

        if (s->rx_timeout < 20)
                s->rx_timeout = 20;

Best regards,
Yoshihiro Shimoda

> Signed-off-by: Ulrich Hecht <uli+renesas@fpond.eu>
> ---
>  drivers/tty/serial/sh-sci.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
> index e3af97a59856..c4ce4cd120ba 100644
> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c
> @@ -2613,11 +2613,11 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
>  	 * Calculate delay for 2 DMA buffers (4 FIFO).
>  	 * See serial_core.c::uart_update_timeout().
>  	 * With 10 bits (CS8), 250Hz, 115200 baud and 64 bytes FIFO, the above
> -	 * function calculates 1 jiffie for the data plus 5 jiffies for the
> -	 * "slop(e)." Then below we calculate 5 jiffies (20ms) for 2 DMA
> -	 * buffers (4 FIFO sizes), but when performing a faster transfer, the
> -	 * value obtained by this formula is too small. Therefore, if the value
> -	 * is smaller than 20ms, use 20ms as the timeout value for DMA.
> +	 * function calculates 4ms for the data plus 20ms for the "slop(e)."
> +	 * Then below we calculate 20ms for 2 DMA buffers (4 FIFO sizes),
> +	 * but when performing a faster transfer, the value obtained by this
> +	 * formula is too small. Therefore, if the value is smaller than
> +	 * 20ms, use 20ms as the timeout value for DMA.
>  	 */
>  	s->rx_frame = (10000 * bits) / (baud / 100);
>  #ifdef CONFIG_SERIAL_SH_SCI_DMA
> --
> 2.20.1


  reply	other threads:[~2021-04-09 12:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09  8:25 [PATCH] serial: sh-sci: correct units in comment about DMA timeout Ulrich Hecht
2021-04-09 12:16 ` Yoshihiro Shimoda [this message]
2021-04-09 16:04   ` Ulrich Hecht
2021-04-12  6:23     ` Yoshihiro Shimoda
2021-04-12  8:04       ` Ulrich Hecht
2021-04-12  8:52         ` Yoshihiro Shimoda

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=OSAPR01MB3683F5855937833872F4FE23D8739@OSAPR01MB3683.jpnprd01.prod.outlook.com \
    --to=yoshihiro.shimoda.uh@renesas.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=uli+renesas@fpond.eu \
    --cc=wsa@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 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.