From: "Frédéric Mahé" <frederic.mahe@cirad.fr>
To: Troy Mitchell <troy.mitchell@linux.dev>
Cc: "Paul Walmsley" <pjw@kernel.org>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Alexandre Ghiti" <alex@ghiti.fr>, "Yixun Lan" <dlan@kernel.org>,
"Troy Mitchell" <troy.mitchell@linux.spacemit.com>,
"Aurelien Jarno" <aurelien@aurel32.net>,
"Anand Moon" <linux.amoon@gmail.com>,
"Jisheng Zhang" <jszhang@kernel.org>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
spacemit@lists.linux.dev,
"Frédéric Mahé" <frederic.mahe@cirad.fr>
Subject: Re: [PATCH v5] riscv: disable local interrupts and stop other CPUs before reboot/shutdown
Date: Mon, 9 Nov 2026 12:00:43 +0100 [thread overview]
Message-ID: <20261109110104.293157-1-frederic.mahe@cirad.fr> (raw)
In-Reply-To: <20261104-v7-0-rc1-rv-dis-int-before-restart-v5-1-956ec09c900d@linux.dev>
On Wed, Nov 04, 2026 at 07:05:40AM +0000, Troy Mitchell wrote:
> Specifically, under CONFIG_PREEMPT_RCU, rcu_read_lock() does not increment
> the preempt_count. If local interrupts remain enabled, the environment
> is not guaranteed to be atomic. This can lead to a context misidentification
> within generic kernel teardown code, causing it to incorrectly enter
> non-atomic paths (such as attempting to acquire sleeping locks), which
> results in fatal "scheduling while atomic" splats or system hangs.
On Banana Pi BPI-F3 (SpacemiT K1), v7.4-rc1 defconfig, every reboot warns:
WARNING: kernel/rcu/tree_plugin.h:330 at rcu_note_context_switch+0x46a/0x48a
...
spacemit_i2c_xfer_common+0x342/0x5f6
...
spacemit_p1_restart_handler+0x24/0x5a
do_kernel_restart+0x1e/0x26
With this patch the warning is gone (2/2 clean reboots, 2/2 warnings
without it). Testing done with the help of Claude (AI assistant).
Tested-by: Frédéric Mahé <frederic.mahe@cirad.fr>
prev parent reply other threads:[~2026-11-09 11:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 7:05 Troy Mitchell
2026-11-09 11:00 ` Frédéric Mahé [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=20261109110104.293157-1-frederic.mahe@cirad.fr \
--to=frederic.mahe@cirad.fr \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=aurelien@aurel32.net \
--cc=dlan@kernel.org \
--cc=jszhang@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux.amoon@gmail.com \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=spacemit@lists.linux.dev \
--cc=troy.mitchell@linux.dev \
--cc=troy.mitchell@linux.spacemit.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
all inboxes | Powered by JetHome®