Linux Serial subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Zhan Xusheng" <zhanxusheng1024@gmail.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH v3 2/2] tty: sysrq: reset the per-device key state when reparsing reset_seq
Date: Wed, 21 Oct 2026 02:27:15 +0000	[thread overview]
Message-ID: <sashiko-outbox-179700@kernel.org> (raw)
In-Reply-To: <20261021022007.1717207-3-zhanxusheng1024@gmail.com>

> From: Zhan Xusheng <zhanxusheng@xiaomi.com>
> 
> sysrq_parse_reset_sequence() clears reset_seq_cnt, but reset_keybit is
> only ever __set_bit() and reset_seq_len only ever incremented.  struct
> sysrq_state is allocated once per input device in sysrq_connect() and
> lives until the device goes away, so both accumulate every time the
> sequence is reparsed, which happens whenever the mode 0644 reset_seq
> parameter is written.
> 
> After writing 56,29,111 and then 59,60 a device keeps all five keys in
> reset_keybit with reset_seq_len 5, so the effective combination is the
> union of the old and the new sequence.  Holding just 59 and 60 counts two
> of five and does nothing, while releasing a stale key drives
> reset_seq_cnt below zero.
> 
> Clear both along with reset_seq_cnt.  Also delete keyreset_timer: with
> sysrq_downtime_ms set, holding a full sequence arms it, and it is only
> deleted on a press outside the sequence or a release inside it.  Dropping
> the old keys from reset_keybit removes both of those cancellations, so an
> already armed reset would survive into orderly_reboot().
> 
> Fixes: 154b7a489a5b ("Input: sysrq - allow specifying alternate reset sequence")
> Cc: stable@vger.kernel.org
> Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261021022007.1717207-1-zhanxusheng1024@gmail.com?part=2


      reply	other threads:[~2026-10-21  2:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21  2:20 [PATCH v3 0/2] tty: sysrq: fix the reset sequence state kept per input device Zhan Xusheng
2026-10-21  2:20 ` [PATCH v3 1/2] tty: sysrq: reparse the reset sequence when its length changes Zhan Xusheng
2026-10-21  2:34   ` sashiko-bot
2026-10-21  2:20 ` [PATCH v3 2/2] tty: sysrq: reset the per-device key state when reparsing reset_seq Zhan Xusheng
2026-10-21  2:27   ` 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-179700@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=zhanxusheng1024@gmail.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