diff mbox series

[v3,06/12] reboot: indicate whether it is a HARDWARE PROTECTION reboot or shutdown

Message ID 20250217-hw_protection-reboot-v3-6-e1c09b090c0c@pengutronix.de (mailing list archive)
State New
Headers show
Series reboot: support runtime configuration of emergency hw_protection action | expand

Commit Message

Ahmad Fatoum Feb. 17, 2025, 8:39 p.m. UTC
It currently depends on the caller, whether we attempt a hardware
protection shutdown (poweroff) or a reboot. A follow-up commit will make
this partially user-configurable, so it's a good idea to have the
emergency message clearly state whether the kernel is going for a reboot
or a shutdown.

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 kernel/reboot.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/kernel/reboot.c b/kernel/reboot.c
index c1f11d5e085e4d2fffc841a624c8b650aba276b8..faf1ff422634d19ef96c59b74dd4bf94d96af592 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -1027,7 +1027,8 @@  void __hw_protection_trigger(const char *reason, int ms_until_forced,
 {
 	static atomic_t allow_proceed = ATOMIC_INIT(1);
 
-	pr_emerg("HARDWARE PROTECTION shutdown (%s)\n", reason);
+	pr_emerg("HARDWARE PROTECTION %s (%s)\n",
+		 hw_protection_action_str(action), reason);
 
 	/* Shutdown should be initiated only once. */
 	if (!atomic_dec_and_test(&allow_proceed))