From: Daniel Mack <daniel@zonque.org>
To: Hugo Villeneuve <hugo@hugovil.com>
Cc: gregkh@linuxfoundation.org, jirislaby@kernel.org,
lech.perczak@camlingroup.com, u.kleine-koenig@pengutronix.de,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
Maxim Popov <maxim.snafu@gmail.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] serial: sc16is7xx: address RX timeout interrupt errata
Date: Tue, 14 Nov 2023 16:55:33 +0100 [thread overview]
Message-ID: <140280a6-1948-4630-b10c-8e6a2afec2de@zonque.org> (raw)
In-Reply-To: <20231114102025.d48c0a6ec6c413f274b7680b@hugovil.com>
Hi Hugo,
On 11/14/23 16:20, Hugo Villeneuve wrote:
> On Tue, 14 Nov 2023 08:49:04 +0100
> Daniel Mack <daniel@zonque.org> wrote:
>> This devices has a silicon bug that makes it report a timeout interrupt
>> but no data in FIFO.
>>
>> The datasheet states the following in the errata section 18.1.4:
>>
>> "If the host reads the receive FIFO at the at the same time as a
>> time-out interrupt condition happens, the host might read 0xCC
>> (time-out) in the Interrupt Indication Register (IIR), but bit 0
>> of the Line Status Register (LSR) is not set (means there is not
>> data in the receive FIFO)."
>>
>> When this happens, the loop in sc16is7xx_irq() will run forever,
>> which effectively blocks the i2c bus and breaks the functionality
>> of the UART.
>>
>> From the information above, it is assumed that when the bug is
>> triggered, the FIFO does in fact have payload in its buffer, but the
>> fill level reporting is off-by-one. Hence this patch fixes the issue
>> by reading one byte from the FIFO when that condition is detected.
>
> From what I understand from the errata, when the problem occurs, it
> affects bit 0 of the LSR register. I see no mention that it
> also affects the RX FIFO level register (SC16IS7XX_RXLVL_REG)?
True, the errata doesn't explicitly mention that, but tests have shown
that the RXLVL register is equally affected.
> LSR[0] would be checked only if we were using polled mode of
> operation, but we always use the interrupt mode (IRQ), and therefore I
> would say that this errata doesn't apply to this driver, and the
> patch is not necessary...
Well, it is. We have seen this bug in the wild and extensively
stress-tested the patch on dozens of boards for many days. Without this
patch, kernels on affected systems would consume a lot of CPU cycles in
the interrupt threads and effectively render the I2C bus unusable due to
the busy polling.
With this patch applied, we were no longer able to reproduce the issue.
Thanks,
Daniel
next prev parent reply other threads:[~2023-11-14 16:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-14 7:49 Daniel Mack
2023-11-14 15:20 ` Hugo Villeneuve
2023-11-14 15:55 ` Daniel Mack [this message]
2023-11-15 10:51 ` Lech Perczak
2023-11-15 11:22 ` Daniel Mack
2023-11-15 15:01 ` Hugo Villeneuve
2023-11-15 15:12 ` Daniel Mack
2023-11-15 14:47 ` Hugo Villeneuve
2023-11-15 14:57 ` Daniel Mack
2023-11-15 15:31 ` Hugo Villeneuve
2023-11-15 15:38 ` Daniel Mack
2023-11-15 14:49 ` Hugo Villeneuve
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=140280a6-1948-4630-b10c-8e6a2afec2de@zonque.org \
--to=daniel@zonque.org \
--cc=gregkh@linuxfoundation.org \
--cc=hugo@hugovil.com \
--cc=jirislaby@kernel.org \
--cc=lech.perczak@camlingroup.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=maxim.snafu@gmail.com \
--cc=stable@vger.kernel.org \
--cc=u.kleine-koenig@pengutronix.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 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®