Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

reboot: rename now misleading __hw_protection_shutdown symbols

The __hw_protection_shutdown function name has become misleading since it
can cause either a shutdown (poweroff) or a reboot depending on its
argument.

To avoid further confusion, let's rename it, so it doesn't suggest that a
poweroff is all it can do.

Link: https://lkml.kernel.org/r/20250217-hw_protection-reboot-v3-5-e1c09b090c0c@pengutronix.de
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Cc: Benson Leung <bleung@chromium.org>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Guenter Roeck <groeck@chromium.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Lukasz Luba <lukasz.luba@arm.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Matteo Croce <teknoraver@meta.com>
Cc: Matti Vaittinen <mazziesaccount@gmail.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Rob Herring (Arm) <robh@kernel.org>
Cc: Rui Zhang <rui.zhang@intel.com>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Ahmad Fatoum and committed by
Andrew Morton
81cab0f9 aafb1245

+8 -8
+4 -4
include/linux/reboot.h
··· 188 188 */ 189 189 enum hw_protection_action { HWPROT_ACT_SHUTDOWN, HWPROT_ACT_REBOOT }; 190 190 191 - void __hw_protection_shutdown(const char *reason, int ms_until_forced, 192 - enum hw_protection_action action); 191 + void __hw_protection_trigger(const char *reason, int ms_until_forced, 192 + enum hw_protection_action action); 193 193 194 194 static inline void hw_protection_reboot(const char *reason, int ms_until_forced) 195 195 { 196 - __hw_protection_shutdown(reason, ms_until_forced, HWPROT_ACT_REBOOT); 196 + __hw_protection_trigger(reason, ms_until_forced, HWPROT_ACT_REBOOT); 197 197 } 198 198 199 199 static inline void hw_protection_shutdown(const char *reason, int ms_until_forced) 200 200 { 201 - __hw_protection_shutdown(reason, ms_until_forced, HWPROT_ACT_SHUTDOWN); 201 + __hw_protection_trigger(reason, ms_until_forced, HWPROT_ACT_SHUTDOWN); 202 202 } 203 203 204 204 /*
+4 -4
kernel/reboot.c
··· 1008 1008 } 1009 1009 1010 1010 /** 1011 - * __hw_protection_shutdown - Trigger an emergency system shutdown or reboot 1011 + * __hw_protection_trigger - Trigger an emergency system shutdown or reboot 1012 1012 * 1013 1013 * @reason: Reason of emergency shutdown or reboot to be printed. 1014 1014 * @ms_until_forced: Time to wait for orderly shutdown or reboot before ··· 1022 1022 * pending even if the previous request has given a large timeout for forced 1023 1023 * shutdown/reboot. 1024 1024 */ 1025 - void __hw_protection_shutdown(const char *reason, int ms_until_forced, 1026 - enum hw_protection_action action) 1025 + void __hw_protection_trigger(const char *reason, int ms_until_forced, 1026 + enum hw_protection_action action) 1027 1027 { 1028 1028 static atomic_t allow_proceed = ATOMIC_INIT(1); 1029 1029 ··· 1043 1043 else 1044 1044 orderly_poweroff(true); 1045 1045 } 1046 - EXPORT_SYMBOL_GPL(__hw_protection_shutdown); 1046 + EXPORT_SYMBOL_GPL(__hw_protection_trigger); 1047 1047 1048 1048 static int __init reboot_setup(char *str) 1049 1049 {