All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alexander Shiyan <shc_work@mail.ru>,
	linux-serial@vger.kernel.org, Jiri Slaby <jirislaby@kernel.org>
Subject: Re: [PATCH] Revert "serial: max310x: rework RX interrupt handling"
Date: Thu, 18 Feb 2021 08:20:51 +0100	[thread overview]
Message-ID: <20210218082051.648b8122@windsurf.home> (raw)
In-Reply-To: <YC4TJQew3QK4iPvP@kroah.com>

Hello Greg,

On Thu, 18 Feb 2021 08:11:33 +0100
Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> What aspects need configuring and why is this uart so unique from all
> others that it can't use the normal configuration methods?

What makes is stand out from other UARTs is that it is over SPI. So
accessing every single register of the UART is much more expensive than
with UART controllers on MMIO.

As explained in commit fce3c5c1a2d9cd888f2987662ce17c0c651916b2, in its
original state, the driver was configuring the UART to get an interrupt
for every single byte being received, causing a huge CPU load (25% in
my use case) for a very simple workload that consists in receiving 20
bytes every 16ms.

What fce3c5c1a2d9cd888f2987662ce17c0c651916b2 does it to configure the
UART controller to not interrupt at every byte being received, but only
when the RX FIFO has reached a certain threshold *or* after some time
without receiving data. Clearly, this is trading throughput against
latency.

So what needs to be configured are two aspects:

 * How many bytes the UART will receive before triggering an interrupt
   and delivering data to the TTY layer/userspace.

 * How much time with no data received before the UART triggers and
   interrupt, and received data is delivered to the TTY layer/userspace.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2021-02-18  7:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17  8:06 [PATCH] Revert "serial: max310x: rework RX interrupt handling" Alexander Shiyan
2021-02-17 22:53 ` Thomas Petazzoni
2021-02-18  3:55   ` Alexander Shiyan
2021-02-18  6:51     ` Thomas Petazzoni
2021-02-18  7:11       ` Greg Kroah-Hartman
2021-02-18  7:20         ` Thomas Petazzoni [this message]
2021-02-18  8:07           ` Greg Kroah-Hartman

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=20210218082051.648b8122@windsurf.home \
    --to=thomas.petazzoni@bootlin.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=shc_work@mail.ru \
    /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.