From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Phil Elwell <phil@raspberrypi.com>
Cc: Jiri Slaby <jirislaby@kernel.org>, linux-serial@vger.kernel.org
Subject: Re: [PATCH] sc16is7xx: Fix for incorrect data being transmitted
Date: Wed, 16 Feb 2022 16:20:58 +0100 [thread overview]
Message-ID: <Yg0WWr04G2yPo8TG@kroah.com> (raw)
In-Reply-To: <20220216150858.1016784-1-phil@raspberrypi.com>
On Wed, Feb 16, 2022 at 03:08:58PM +0000, Phil Elwell wrote:
> UART drivers are meant to use the port spinlock within certain
> methods, to protect against reentrancy. The sc16is7xx driver does
> very little locking, presumably because when added it triggers
> "scheduling while atomic" errors. This is due to the use of mutexes
> within the regmap abstraction layer, and the mutex implementation's
> habit of sleeping the current thread while waiting for access.
> Unfortunately this lack of interlocking can lead to corruption of
> outbound data, which occurs when the buffer used for I2C transmission
> is used simultaneously by two threads - a work queue thread running
> sc16is7xx_tx_proc, and an IRQ thread in sc16is7xx_port_irq, both
> of which can call sc16is7xx_handle_tx.
>
> An earlier patch added efr_lock, a mutex that controls access to the
> EFR register. This mutex is already claimed in the IRQ handler, and
> all that is required is to claim the same mutex in sc16is7xx_tx_proc.
>
> See: https://github.com/raspberrypi/linux/issues/4885
>
> Signed-off-by: Phil Elwell <phil@raspberrypi.com>
> ---
> drivers/tty/serial/sc16is7xx.c | 3 +++
> 1 file changed, 3 insertions(+)
What commit id does this fix?
thanks,
greg k-h
next prev parent reply other threads:[~2022-02-16 15:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-16 15:08 [PATCH] sc16is7xx: Fix for incorrect data being transmitted Phil Elwell
2022-02-16 15:20 ` Greg Kroah-Hartman [this message]
2022-02-16 15:34 ` Phil Elwell
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=Yg0WWr04G2yPo8TG@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=phil@raspberrypi.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