Linux Serial subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Zhenwen Liang" <zhenwenliang@google.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH] serial: core: take the port lock when setting DTR in uart_set_options()
Date: Mon, 23 Nov 2026 22:58:23 +0000	[thread overview]
Message-ID: <sashiko-outbox-230176@kernel.org> (raw)
In-Reply-To: <20261123225239.1653134-1-zhenwenliang@google.com>

> uart_set_options() sets DTR with a plain read-modify-write of
> port->mctrl:
> 
> 	port->mctrl |= TIOCM_DTR;
> 
> uart_update_mctrl(), which uart_throttle() and the other modem control
> updates on an open port use, holds the port lock. kgdboc calls
> uart_set_options() through uart_poll_init() for a port that can be open
> and in use as a tty, so this update can race with them. If
> uart_throttle() clears RTS between the load and the store, the store
> puts the old RTS bit back, and the following set_termios() call writes
> it to the hardware (8250 does so in serial8250_do_set_termios()). RTS
> then stays asserted while the tty is throttled, and hardware flow
> control no longer stops the other side.
> 
> [ ... ]
> AI-assisted analysis. The patch and this description were written with
> AI assistance; a human checked them against the source.
> 
> Fixes: f2d937f3bf00 ("consoles: polling support, kgdboc")
> Signed-off-by: Zhenwen Liang <zhenwenliang@google.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261123225239.1653134-1-zhenwenliang@google.com?part=1

      reply	other threads:[~2026-11-23 22:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 22:52 [PATCH] serial: core: take the port lock when setting DTR in uart_set_options() Zhenwen Liang
2026-11-23 22:58 ` sashiko-bot [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=sashiko-outbox-230176@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=zhenwenliang@google.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