[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251118025015.42491-3-cuiyunhui@bytedance.com>
Date: Tue, 18 Nov 2025 10:50:09 +0800
From: Yunhui Cui <cuiyunhui@...edance.com>
To: conor@...nel.org,
paul.walmsley@...ive.com,
palmer@...belt.com,
aou@...s.berkeley.edu,
alex@...ti.fr,
cuiyunhui@...edance.com,
luxu.kernel@...edance.com,
linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org,
jassisinghbrar@...il.com,
conor.dooley@...rochip.com,
valentina.fernandezalanis@...rochip.com,
catalin.marinas@....com,
will@...nel.org,
maz@...nel.org,
timothy.hayes@....com,
lpieralisi@...nel.org,
arnd@...db.de,
kees@...nel.org,
tglx@...utronix.de,
viresh.kumar@...aro.org,
boqun.feng@...il.com,
linux-arm-kernel@...ts.infradead.org,
cleger@...osinc.com,
atishp@...osinc.com,
ajones@...tanamicro.com
Subject: [PATCH v2 2/8] riscv: smp: move ipi_cpu_crash_stop() declaration to smp.h
Move ipi_cpu_crash_stop() declaration from smp.c to smp.h to enable
external reference, and rename it to cpu_crash_stop().
Signed-off-by: Yunhui Cui <cuiyunhui@...edance.com>
---
arch/riscv/include/asm/smp.h | 9 +++++++++
arch/riscv/kernel/smp.c | 9 ++-------
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/arch/riscv/include/asm/smp.h b/arch/riscv/include/asm/smp.h
index 7ac80e9f22889..f53f1f0e7aa9e 100644
--- a/arch/riscv/include/asm/smp.h
+++ b/arch/riscv/include/asm/smp.h
@@ -54,6 +54,15 @@ void riscv_ipi_set_virq_range(int virq, int nr);
/* Check other CPUs stop or not */
bool smp_crash_stop_failed(void);
+#ifdef CONFIG_KEXEC_CORE
+void cpu_crash_stop(unsigned int cpu, struct pt_regs *regs);
+#else
+static inline void cpu_crash_stop(unsigned int cpu, struct pt_regs *regs)
+{
+ unreachable();
+}
+#endif
+
/* Secondary hart entry */
asmlinkage void smp_callin(void);
diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c
index e650dec448176..9dbcb9a06a96d 100644
--- a/arch/riscv/kernel/smp.c
+++ b/arch/riscv/kernel/smp.c
@@ -78,7 +78,7 @@ static void ipi_stop(void)
#ifdef CONFIG_KEXEC_CORE
static atomic_t waiting_for_crash_ipi = ATOMIC_INIT(0);
-static inline void ipi_cpu_crash_stop(unsigned int cpu, struct pt_regs *regs)
+void cpu_crash_stop(unsigned int cpu, struct pt_regs *regs)
{
crash_save_cpu(regs, cpu);
@@ -94,11 +94,6 @@ static inline void ipi_cpu_crash_stop(unsigned int cpu, struct pt_regs *regs)
for(;;)
wait_for_interrupt();
}
-#else
-static inline void ipi_cpu_crash_stop(unsigned int cpu, struct pt_regs *regs)
-{
- unreachable();
-}
#endif
static void send_ipi_mask(const struct cpumask *mask, enum ipi_message_type op)
@@ -134,7 +129,7 @@ static irqreturn_t handle_IPI(int irq, void *data)
ipi_stop();
break;
case IPI_CPU_CRASH_STOP:
- ipi_cpu_crash_stop(cpu, get_irq_regs());
+ cpu_crash_stop(cpu, get_irq_regs());
break;
case IPI_IRQ_WORK:
irq_work_run();
--
2.39.5
Powered by blists - more mailing lists