linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] panic: call panic handlers before panic_other_cpus_shutdown()
@ 2025-02-20 22:53 Hamza Mahfooz
  2025-02-21  2:23 ` Ryo Takakura
  0 siblings, 1 reply; 6+ messages in thread
From: Hamza Mahfooz @ 2025-02-20 22:53 UTC (permalink / raw)
  To: linux-kernel
  Cc: Wei Liu, linux-hyperv, Dexuan Cui, Haiyang Zhang, Hamza Mahfooz,
	Petr Mladek, Andrew Morton, Jani Nikula, Greg Kroah-Hartman,
	John Ogness, Baoquan He, Joel Granados, Jocelyn Falempe,
	Ryo Takakura

Since, the panic handlers may require certain cpus to be online to panic
gracefully, we should call them before turning off SMP. Without this
re-ordering, on Hyper-V hv_panic_vmbus_unload() times out, because the
vmbus channel is bound to VMBUS_CONNECT_CPU and unless the crashing cpu
is the same as VMBUS_CONNECT_CPU, VMBUS_CONNECT_CPU will be offlined by
crash_smp_send_stop() before the vmbus channel can be deconstructed.

Signed-off-by: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
---
 kernel/panic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index fbc59b3b64d0..9712a46dfe27 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -372,8 +372,6 @@ void panic(const char *fmt, ...)
 	if (!_crash_kexec_post_notifiers)
 		__crash_kexec(NULL);
 
-	panic_other_cpus_shutdown(_crash_kexec_post_notifiers);
-
 	printk_legacy_allow_panic_sync();
 
 	/*
@@ -382,6 +380,8 @@ void panic(const char *fmt, ...)
 	 */
 	atomic_notifier_call_chain(&panic_notifier_list, 0, buf);
 
+	panic_other_cpus_shutdown(_crash_kexec_post_notifiers);
+
 	panic_print_sys_info(false);
 
 	kmsg_dump_desc(KMSG_DUMP_PANIC, buf);
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-03-02  6:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-20 22:53 [PATCH RFC] panic: call panic handlers before panic_other_cpus_shutdown() Hamza Mahfooz
2025-02-21  2:23 ` Ryo Takakura
2025-02-21 21:23   ` Hamza Mahfooz
2025-02-22  5:44     ` Ryo Takakura
2025-02-26 15:49       ` Petr Mladek
2025-03-02  6:36         ` Ryo Takakura

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).