From: Yong-Xuan Wang <yongxuan.wang@sifive.com>
To: Anup Patel <anup@brainfault.org>,
Thomas Gleixner <tglx@kernel.org>,
Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>
Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
greentime.hu@sifive.com, vincent.chen@sifive.com,
zong.li@sifive.com, Yong-Xuan Wang <yongxuan.wang@sifive.com>
Subject: [PATCH v2] irqchip/riscv-imsic: sync-up state before CPU offline
Date: Fri, 08 May 2026 02:31:21 -0700 [thread overview]
Message-ID: <20260508-imsic-v2-1-e9f08dd46cf5@sifive.com> (raw)
The "move_prev" pointer in struct imsic_vector on the new CPU is
cleared only after the old CPU has cleared "move_next". But when
migrating all the interrupts out from an offling CPU, since the CPU
is already marked as "offlined", the IMSIC driver skip to sync-up the
interrupt vector in __imsic_remote_sync(). The "move_prev" pointer of
these interrupts can only be cleared after the old CPU backs to online.
Therefore, the affinity of interrupts originally targeting an offlined
CPU cannot be updated.
Clear the "move_prev" pointers in the CPU hotplug offline path to avoid
stale migration state on offlined CPUs.
Fixes: 0f67911e821c ("irqchip/riscv-imsic: Separate next and previous pointers in IMSIC vector")
Signed-off-by: Yong-Xuan Wang <yongxuan.wang@sifive.com>
---
Changes in v2:
- Update the description and add the fixes tag (Thomas)
- Link to v1: https://patch.msgid.link/20260503-imsic-v1-1-aa8330bd1c34@sifive.com
---
drivers/irqchip/irq-riscv-imsic-early.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/irqchip/irq-riscv-imsic-early.c b/drivers/irqchip/irq-riscv-imsic-early.c
index ba903fa689bd..a7a1852b548c 100644
--- a/drivers/irqchip/irq-riscv-imsic-early.c
+++ b/drivers/irqchip/irq-riscv-imsic-early.c
@@ -158,6 +158,8 @@ static int imsic_dying_cpu(unsigned int cpu)
/* Cleanup IPIs */
imsic_ipi_dying_cpu();
+ imsic_local_sync_all(false);
+
/* Mark per-CPU IMSIC state as offline */
imsic_state_offline();
---
base-commit: 9b3a2be84803cf18c4b4d1efc695991f0daa153c
change-id: 20260503-imsic-d70c156cb740
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
reply other threads:[~2026-05-08 9:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260508-imsic-v2-1-e9f08dd46cf5@sifive.com \
--to=yongxuan.wang@sifive.com \
--cc=alex@ghiti.fr \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=greentime.hu@sifive.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=tglx@kernel.org \
--cc=vincent.chen@sifive.com \
--cc=zong.li@sifive.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