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

Ahmad Fatoum posted 12 patches 11 months, 1 week ago
There is a newer version of this series
[PATCH v2 06/12] reboot: indicate whether it is a HARDWARE PROTECTION reboot or shutdown
Posted by Ahmad Fatoum 11 months, 1 week ago
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.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 kernel/reboot.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/reboot.c b/kernel/reboot.c
index eee4f449181f0cf3662892f4001f9a3074ec4881..c0333b0a901f2cea7e39d1ac04c57bc9a5c9ba20 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))

-- 
2.39.5
Re: [PATCH v2 06/12] reboot: indicate whether it is a HARDWARE PROTECTION reboot or shutdown
Posted by Tzung-Bi Shih 11 months ago
On Mon, Jan 13, 2025 at 05:25:31PM +0100, Ahmad Fatoum wrote:
> 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.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>