mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: "Kumar, Udit" <u-kumar1@ti.com>
Cc: Moteen Shah <m-shah@ti.com>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	krzk+dt@kernel.org,  linux-serial <linux-serial@vger.kernel.org>,
	 LKML <linux-kernel@vger.kernel.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	 devicetree@vger.kernel.org, gehariprasath@ti.com,
	vigneshr@ti.com,  nm@ti.com, a-limaye@ti.com,
	y-abhilashchandra@ti.com
Subject: Re: [PATCH v2 2/2] serial: 8250_dw: Add capability to skip empty FIFO read
Date: Thu, 17 Sep 2026 12:40:03 +0300 (EEST)	[thread overview]
Message-ID: <d82f9326-6a01-2903-a1b7-b1617ca85db9@linux.intel.com> (raw)
In-Reply-To: <5801b899-8090-4bff-b4e2-c3e8c97b0eb3@ti.com>

[-- Attachment #1: Type: text/plain, Size: 2437 bytes --]

On Wed, 16 Sep 2026, Kumar, Udit wrote:
> On 9/16/2026 4:22 PM, Ilpo Järvinen wrote:
> > On Wed, 16 Sep 2026, Moteen Shah wrote:
> > 
> >> dw8250_handle_irq() does a bogus RX read on RX_TIMEOUT with no data
> >> present, to avoid an interrupt storm. The UART core also performs
> >> unconditional reads on the empty FIFO during startup and shutdown
> >> of the port. On the IP version used in TDA54, that interrupt storm
> >> no longer occurs, but reading an empty FIFO instead triggers a data
> >> abort.
> >>
> >> Add a new capability to guard against the empty FIFO reads, avoiding
> >> the data aborts.
> >>
> >> Signed-off-by: Moteen Shah <m-shah@ti.com>
> >> ---
> >>  drivers/tty/serial/8250/8250.h      |  1 +
> >>  drivers/tty/serial/8250/8250_dw.c   | 16 +++++++++++++++-
> >>  drivers/tty/serial/8250/8250_port.c | 12 +++++++++---
> >>  3 files changed, 25 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h
> >> index 77fe0588fd6b..45e13c3a8c14 100644
> >> --- a/drivers/tty/serial/8250/8250.h
> >> +++ b/drivers/tty/serial/8250/8250.h
> >> @@ -86,6 +86,7 @@ struct serial8250_config {
> >>  					 * STOP PARITY EPAR SPAR WLEN5 WLEN6
> >>  					 */
> >>  #define UART_CAP_NOTEMT	BIT(18)	/* UART without interrupt on TEMT available */
> >> +#define UART_CAP_RXFIFO_EMPTY_READ	BIT(19) /* UART needs LSR_DR check before RX read (TDA54) */
> > 
> > IMO, this define naming contradicts with the comment because you 
> > effectively say "capable of reading Rx while receive buffer is empty", not 
> > that it needs DR check before issuing that read on buffer (~ named exactly 
> > opposite of the actual meaning it is being used in the code).
> > 
> 
> I echo your comments; the naming should reflect that the IP does not
> allow reading an empty FIFO.

I now recalled we've also the pending RBR -> SRBR change:

https://lore.kernel.org/linux-serial/20260908141524.20302-1-yang.yicong@picoheart.com/#t

I wonder if a similar thing would help in this case as well?

I understand this patch covers more ground than the SRBR patch but can the 
IP used in this case read SRBR without aborting?

> At the same time, I am thinking, reading the FIFO based on the
> UART_LSR_DR bit being set in the serial8250_clear_interrupts and
> serial8250_do_shutdown functions.
> Do you see any side effects to this?



-- 
 i.

      reply	other threads:[~2026-09-17  9:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16  8:55 [PATCH v2 0/2] serial: 8250_dw: Add ti,tda54-uart support Moteen Shah
2026-09-16  8:55 ` [PATCH v2 1/2] dt-bindings: serial: snps-dw-apb-uart: Add ti,tda54-uart Moteen Shah
2026-09-16  8:55 ` [PATCH v2 2/2] serial: 8250_dw: Add capability to skip empty FIFO read Moteen Shah
2026-09-16 10:52   ` Ilpo Järvinen
2026-09-16 12:55     ` Moteen Shah
2026-09-16 14:32       ` Hari Prasath G E
2026-09-16 13:47     ` Kumar, Udit
2026-09-17  9:40       ` Ilpo Järvinen [this message]

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=d82f9326-6a01-2903-a1b7-b1617ca85db9@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=a-limaye@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gehariprasath@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=m-shah@ti.com \
    --cc=nm@ti.com \
    --cc=u-kumar1@ti.com \
    --cc=vigneshr@ti.com \
    --cc=y-abhilashchandra@ti.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

all inboxes | Powered by JetHome®