[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z4Ti24Sw4zo5-wqe@smile.fi.intel.com>
Date: Mon, 13 Jan 2025 11:54:35 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: John Ogness <john.ogness@...utronix.de>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>, Petr Mladek <pmladek@...e.com>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Steven Rostedt <rostedt@...dmis.org>,
Thomas Gleixner <tglx@...utronix.de>,
Esben Haabendal <esben@...nix.com>, linux-serial@...r.kernel.org,
linux-kernel@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
Niklas Schnelle <schnelle@...ux.ibm.com>,
Serge Semin <fancer.lancer@...il.com>
Subject: Re: [PATCH tty-next v5 2/6] serial: 8250: Use frame time to
determine timeout
On Tue, Jan 07, 2025 at 10:32:58PM +0106, John Ogness wrote:
> Rather than using a hard-coded per-character Tx-timeout of 10ms,
> use the frame time to determine a timeout value. The value is
> doubled to ensure that a timeout is only hit during unexpected
> circumstances.
>
> Since the frame time may not be available during early printing,
> the previous 10ms value is kept as a fallback.
...
> + /*
> + * Wait for a character to be sent. Fallback to a safe default
> + * timeout value if @frame_time is not available.
> + */
> + if (up->port.frame_time)
> + tmout = up->port.frame_time * 2 / NSEC_PER_USEC;
> + else
> + tmout = 10000;
I would use it in a form of
tmout = 10 * USEC_PER_MSEC;
This will give a hint of the real unit (10 ms in us).
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists