From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: John Ogness <john.ogness@linutronix.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>, Petr Mladek <pmladek@suse.com>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Steven Rostedt <rostedt@goodmis.org>,
Thomas Gleixner <tglx@linutronix.de>,
Esben Haabendal <esben@geanix.com>,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
Arnd Bergmann <arnd@arndb.de>,
Niklas Schnelle <schnelle@linux.ibm.com>,
Serge Semin <fancer.lancer@gmail.com>
Subject: Re: [PATCH tty-next v5 2/6] serial: 8250: Use frame time to determine timeout
Date: Mon, 13 Jan 2025 11:54:35 +0200 [thread overview]
Message-ID: <Z4Ti24Sw4zo5-wqe@smile.fi.intel.com> (raw)
In-Reply-To: <20250107212702.169493-3-john.ogness@linutronix.de>
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
next prev parent reply other threads:[~2025-01-13 9:54 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 21:26 [PATCH tty-next v5 0/6] convert 8250 to nbcon John Ogness
2025-01-07 21:26 ` [PATCH tty-next v5 1/6] serial: 8250: Adjust the timeout for FIFO mode John Ogness
2025-01-07 21:26 ` [PATCH tty-next v5 2/6] serial: 8250: Use frame time to determine timeout John Ogness
2025-01-13 9:54 ` Andy Shevchenko [this message]
2025-01-07 21:26 ` [PATCH tty-next v5 3/6] serial: 8250: Use high-level writing function for FIFO John Ogness
2025-01-07 21:27 ` [PATCH tty-next v5 4/6] serial: 8250: Provide flag for IER toggling for RS485 John Ogness
2025-01-07 21:27 ` [PATCH tty-next v5 5/6] serial: 8250: Switch to nbcon console John Ogness
2025-01-09 16:13 ` Petr Mladek
2025-01-15 16:21 ` Jon Hunter
2025-01-15 16:54 ` John Ogness
2025-01-16 10:27 ` Jon Hunter
2025-01-16 10:38 ` John Ogness
2025-01-16 10:41 ` Jon Hunter
2025-01-20 16:23 ` Thierry Reding
2025-01-20 16:34 ` Thierry Reding
2025-01-27 14:54 ` Jon Hunter
2025-01-27 15:20 ` Petr Mladek
2025-01-27 15:21 ` John Ogness
2025-01-27 16:13 ` Jon Hunter
2025-10-08 15:56 ` John Ogness
2025-10-08 19:21 ` Jon Hunter
2025-10-09 10:04 ` Thierry Reding
2025-10-09 11:49 ` John Ogness
2025-10-09 12:54 ` Petr Mladek
2025-01-07 21:27 ` [PATCH tty-next v5 6/6] serial: 8250: Revert "drop lockdep annotation from serial8250_clear_IER()" John Ogness
2025-01-09 16:13 ` Petr Mladek
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=Z4Ti24Sw4zo5-wqe@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=arnd@arndb.de \
--cc=esben@geanix.com \
--cc=fancer.lancer@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=john.ogness@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=schnelle@linux.ibm.com \
--cc=senozhatsky@chromium.org \
--cc=tglx@linutronix.de \
/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.