From: sashiko-bot@kernel.org
To: "Ginger Li" <ginger.jzllee@gmail.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH v2] serial: max3100: Fix a data race on s->rts in max3100_work()
Date: Tue, 22 Sep 2026 17:12:14 +0000 [thread overview]
Message-ID: <20260922171214.B36351F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260922170239.33485-1-ginger.jzllee@gmail.com>
> max3100_set_mctrl() stores the new RTS state and raises s->rts_commit to tell
> max3100_work() that it has to program it:
>
> spin_lock(&s->conf_lock);
> if (s->rts != rts) {
> s->rts = rts;
> s->rts_commit = 1;
> }
> if (s->loopback_commit || s->rts_commit)
> max3100_dowork(s);
> spin_unlock(&s->conf_lock);
>
> max3100_work() consumes s->rts_commit under s->conf_lock, but reads s->rts
> itself outside of the lock, both when it services that pending update and when
> it later transmits a character, so the state it programs into the hardware can
> be stale.
>
> Read s->rts into a local variable in the s->conf_lock protected snapshot at
> the top of the loop, before s->rts_commit is consumed, in the same way as
> s->conf is read before s->conf_commit.
>
> Fixes: 7831d56b0a35 ("tty: MAX3100")
> Signed-off-by: Ginger Li <ginger.jzllee@gmail.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260922170239.33485-1-ginger.jzllee@gmail.com?part=1
next prev parent reply other threads:[~2026-09-22 17:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 5:31 [PATCH] serial: max3100: Fix a data race on s->rts in max3100_work() Ginger Li
2026-09-22 5:40 ` sashiko-bot
2026-09-22 8:17 ` Maarten Brock
2026-09-22 8:26 ` Ginger
2026-09-22 9:25 ` Maarten Brock
2026-09-22 17:04 ` Ginger
2026-09-22 17:02 ` [PATCH v2] " Ginger Li
2026-09-22 17:12 ` sashiko-bot [this message]
2026-09-23 10:31 ` Greg KH
2026-09-24 8:32 ` Maarten Brock
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=20260922171214.B36351F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=ginger.jzllee@gmail.com \
--cc=linux-serial@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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