Linux Serial subsystem development
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Michael Pratt <mcpratt@pm.me>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	 LKML <linux-kernel@vger.kernel.org>,
	 linux-serial <linux-serial@vger.kernel.org>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Jiri Slaby <jirislaby@kernel.org>,
	 Wander Lairson Costa <wander@redhat.com>,
	 Vamshi Gajjela <vamshigajjela@google.com>
Subject: Re: [PATCH v2 1/3] serial: core: Store fifo timeout again
Date: Wed, 17 Apr 2024 11:18:33 +0300 (EEST)	[thread overview]
Message-ID: <35bd3e50-8a60-7c0e-23a9-ae483e293a15@linux.intel.com> (raw)
In-Reply-To: <zTaajAZtS59Hv5offvbHJV1ptivBxD4WaZP_M-zQkicUtDb4mokpuKCFGIzUVL3p2yDSqHx9Uf2vIYVlbGeHN8xMJ6H3VWxwH3MPe1cH5a4=@pm.me>

On Tue, 16 Apr 2024, Michael Pratt wrote:
> On Tuesday, April 16th, 2024 at 14:58, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> 
> > > + if (port->fifosize > 1)
> > > + port->timeout = uart_fifo_timeout(port);
> > 
> > 
> > else
> > port->timeout = port->frame_time;
> > 
> 
> 
> Consistent with what I said in the other reply, the only reason that
> I have an if statement here, is to avoid doing extra math for devices
> without a fifo, as a specifically calculated timeout value would be useless
> in those cases.

Please benchmark to show this actually matters if want to make this claim. 
Otherwise just do the math always.

> However, if you don't like the 10 ms default timeout, perhaps port->frame_time
> could actually be a more reasonable default value? That is, provided 
> that we have a process 
> for calculating the proper value already in place...

While it would be a step toward the correct direction, you'd still need to 
add the safety there which is already done by uart_fifo_timeout(). So no, 
I don't think there's advantage of using port->frame_time over just 
calling uart_fifo_timeout() and ensuring uart_fifo_timeout() is always 
using at least 1 as the FIFO size when it does the calculations.

-- 
 i.


  reply	other threads:[~2024-04-17  8:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16 18:28 [PATCH v2 0/3] serial: 8250: Set fifo timeout with uart_fifo_timeout() Michael Pratt
2024-04-16 18:29 ` [PATCH v2 1/3] serial: core: Store fifo timeout again Michael Pratt
2024-04-16 18:58   ` Andy Shevchenko
2024-04-16 19:20     ` Michael Pratt
2024-04-17  8:18       ` Ilpo Järvinen [this message]
2024-04-17 15:41       ` Wander Lairson Costa
2024-04-17  7:52   ` Ilpo Järvinen
2024-04-16 18:29 ` [PATCH v2 2/3] serial: 8250: Store whether fifo device is enabled Michael Pratt
2024-04-16 18:55   ` Andy Shevchenko
2024-04-16 19:09     ` Michael Pratt
2024-04-16 19:18       ` Andy Shevchenko
2024-04-16 19:40         ` Michael Pratt
2024-04-16 18:34 ` [PATCH v2 3/3] serial: 8250: Set fifo timeout using uart_fifo_timeout() Michael Pratt
2024-04-16 18:57   ` Andy Shevchenko
2024-04-16 19:15     ` Michael Pratt
2024-04-17  8:13       ` Ilpo Järvinen
2024-04-17  8:00   ` Ilpo Järvinen

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=35bd3e50-8a60-7c0e-23a9-ae483e293a15@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=mcpratt@pm.me \
    --cc=vamshigajjela@google.com \
    --cc=wander@redhat.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