From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: "Maciej W. Rozycki" <macro@orcam.me.uk>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>
Cc: Elena Reshetova <elena.reshetova@intel.com>,
David Windsor <dwindsor@gmail.com>, Kees Cook <kees@kernel.org>,
Hans Liljestrand <ishkamiel@gmail.com>,
linux-mips@vger.kernel.org, linux-serial@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 5/6] serial: sb1250-duart: Switch to spinlock protection for shared resource
Date: Wed, 17 Jun 2026 14:01:15 +0200 [thread overview]
Message-ID: <d6fdd40f-6696-44bd-9df4-dbd65f8dc84e@oss.qualcomm.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2605241630370.1450@angie.orcam.me.uk>
On 25/5/26 01:12, Maciej W. Rozycki wrote:
> The control register block is shared between DUART channels and so its
> resource has to be requested by the first channel claimed and released
> by the last one dropped.
>
> It is currently handled with an atomic counter, which however does not
> protect against a situation where request_mem_region() has failed, but
> another CPU has seen the map guard nonzero and refrained from calling
> this function for another channel where it should have (and likely also
> fail). This parallel execution scenario can in principle be arranged
> via the TIOCSSERIAL ioctl.
>
> Switch to using an ordinary counter then and spinlock protection for the
> counter updates along with the corresponding resource request/release
> calls, so that the case described above is covered.
>
> Fixes: b45d52797432 ("sb1250-duart.c: SB1250 DUART serial support")
> Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
> ---
> New change in v2.
> ---
> drivers/tty/serial/sb1250-duart.c | 28 ++++++++++++++++++----------
> 1 file changed, 18 insertions(+), 10 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
next prev parent reply other threads:[~2026-06-17 12:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-24 23:12 [PATCH v2 0/6] MIPS: SiByte: Fix serial device regressions Maciej W. Rozycki
2026-05-24 23:12 ` [PATCH v2 1/6] serial: sb1250-duart: Fix console message clobbering at channel resets Maciej W. Rozycki
2026-06-17 11:55 ` Philippe Mathieu-Daudé
2026-05-24 23:12 ` [PATCH v2 2/6] serial: sb1250-duart: Fix bootconsole handover lockup Maciej W. Rozycki
2026-06-17 11:56 ` Philippe Mathieu-Daudé
2026-05-24 23:12 ` [PATCH v2 3/6] serial: sb1250-duart: Convert to use a platform device Maciej W. Rozycki
2026-07-10 12:25 ` Greg Kroah-Hartman
2026-05-24 23:12 ` [PATCH v2 4/6] Revert "drivers: convert sbd_duart.map_guard from atomic_t to refcount_t" Maciej W. Rozycki
2026-06-17 11:59 ` Philippe Mathieu-Daudé
2026-05-24 23:12 ` [PATCH v2 5/6] serial: sb1250-duart: Switch to spinlock protection for shared resource Maciej W. Rozycki
2026-06-17 12:01 ` Philippe Mathieu-Daudé [this message]
2026-05-24 23:12 ` [PATCH v2 6/6] MAINTAINERS: Add self for the sb1250-duart serial driver Maciej W. Rozycki
2026-06-17 12:01 ` Philippe Mathieu-Daudé
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=d6fdd40f-6696-44bd-9df4-dbd65f8dc84e@oss.qualcomm.com \
--to=philmd@oss.qualcomm.com \
--cc=dwindsor@gmail.com \
--cc=elena.reshetova@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=ishkamiel@gmail.com \
--cc=jirislaby@kernel.org \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=macro@orcam.me.uk \
--cc=tsbogend@alpha.franken.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