[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250221213055.133849-1-hamzamahfooz@linux.microsoft.com>
Date: Fri, 21 Feb 2025 16:30:52 -0500
From: Hamza Mahfooz <hamzamahfooz@...ux.microsoft.com>
To: linux-kernel@...r.kernel.org
Cc: Dexuan Cui <decui@...rosoft.com>,
Wei Liu <wei.liu@...nel.org>,
linux-hyperv@...r.kernel.org,
Haiyang Zhang <haiyangz@...rosoft.com>,
Hamza Mahfooz <hamzamahfooz@...ux.microsoft.com>,
Petr Mladek <pmladek@...e.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
John Ogness <john.ogness@...utronix.de>,
Jani Nikula <jani.nikula@...el.com>,
Baoquan He <bhe@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ryo Takakura <takakura@...inux.co.jp>
Subject: [PATCH v2] panic: call panic handlers before panic_other_cpus_shutdown()
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@...ux.microsoft.com>
---
v2: keep printk_legacy_allow_panic_sync() after
panic_other_cpus_shutdown().
---
kernel/panic.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/panic.c b/kernel/panic.c
index fbc59b3b64d0..433cf651e213 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -372,16 +372,16 @@ 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();
-
/*
* Run any panic handlers, including those that might need to
* add information to the kmsg dump output.
*/
atomic_notifier_call_chain(&panic_notifier_list, 0, buf);
+ panic_other_cpus_shutdown(_crash_kexec_post_notifiers);
+
+ printk_legacy_allow_panic_sync();
+
panic_print_sys_info(false);
kmsg_dump_desc(KMSG_DUMP_PANIC, buf);
--
2.47.1
Powered by blists - more mailing lists