From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>,
Tony Lindgren <tony@atomide.com>,
Peter Hurley <peter@hurleysoftware.com>,
linux-serial <linux-serial@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] serial: 8250_omap: remove wait loop from Errata i202 workaround
Date: Mon, 17 Oct 2022 15:15:50 +0300 (EEST) [thread overview]
Message-ID: <c91216ec-c7e7-df7b-463-ec17c76b7bc2@linux.intel.com> (raw)
In-Reply-To: <Y00bmec4hvWxtnB5@linutronix.de>
[-- Attachment #1: Type: text/plain, Size: 2542 bytes --]
On Mon, 17 Oct 2022, Sebastian Andrzej Siewior wrote:
> On 2022-10-17 11:12:41 [+0300], Ilpo Järvinen wrote:
> > On Thu, 13 Oct 2022, Matthias Schiffer wrote:
> >
> > > We were occasionally seeing the "Errata i202: timedout" on an AM335x
> > > board when repeatedly opening and closing a UART connected to an active
> > > sender. As new input may arrive at any time, it is possible to miss the
> > > "RX FIFO empty" condition, forcing the loop to wait until it times out.
> >
> > I can see this problem could occur and why your patch fixes it.
> >
> > > Nothing in the i202 Advisory states that such a wait is even necessary;
> > > other FIFO clear functions like serial8250_clear_fifos() do not wait
> > > either. For this reason, it seems safe to remove the wait, fixing the
> > > mentioned issue.
> >
> > Checking the commit that added this driver and the loop along with it,
> > there was no information why it would be needed there either.
>
> I don't remember all the details but I do remember that I never hit it.
> The idea back then was to document what appears the problem and then
> once there is a reproducer address it _or_ when there is another problem
> check if it aligns with the output here (so that _this_ problem's origin
> could be this). This was part of address all known chip erratas and
> copied from omap-serial at the time so that the 8250 does not miss
> anything.
> Looking closer, this is still part of the omap-serial driver and it was
> introduced in commit
> 0003450964357 ("omap2/3/4: serial: errata i202: fix for MDR1 access")
I found that one too but it doesn't give any explanation for it either.
In fact, the wait for empty is mysteriously missing from the itemized
description of the workaround in the commit message.
> If someone found a way to trigger this output which is unrelated to the
> expected cause then this is clearly not helping nor intended.
>
> I would prefer to keep the loop and replace the disturbing output with a
> comment describing _why_ the FIFO might remain non-empty after a flush.
>
> In worst cases that loop causes a delay of less than 0.5ms while setting
> a baud rate so I doubt that this is causing a real problem.
>
> Either way I would like to see Tony's ACK before this is getting removed
> as suggested in this patch.
Thanks for chimming in.
I went to do some lore searching and came across this thread (it should
be added with Link: tag the patch regardless of its final form):
https://lore.kernel.org/linux-omap/4BBF61FE.3060807@ti.com/
--
i.
next prev parent reply other threads:[~2022-10-17 12:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-13 11:23 [PATCH] serial: 8250_omap: remove wait loop from Errata i202 workaround Matthias Schiffer
2022-10-17 8:12 ` Ilpo Järvinen
2022-10-17 9:08 ` Sebastian Andrzej Siewior
2022-10-17 12:15 ` Ilpo Järvinen [this message]
2022-10-24 5:28 ` Tony Lindgren
2022-10-26 6:13 ` Vignesh Raghavendra
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=c91216ec-c7e7-df7b-463-ec17c76b7bc2@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=bigeasy@linutronix.de \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=matthias.schiffer@ew.tq-group.com \
--cc=peter@hurleysoftware.com \
--cc=tony@atomide.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;
as well as URLs for NNTP newsgroup(s).