Skip to content

Commit ce8f1cc

Browse files
groeckRussell King (Oracle)
authored andcommitted
ARM: 9094/1: Register with kernel restart handler
By making use of the kernel restart handler, board specific restart handlers can be prioritized amongst available mechanisms for a particular board or system. Select the default priority of 128 to indicate that the restart callback in the machine description is the default restart mechanism. Acked-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
1 parent 2bb565b commit ce8f1cc

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

arch/arm/kernel/setup.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,20 @@ void __init hyp_mode_check(void)
10811081
#endif
10821082
}
10831083

1084+
static void (*__arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);
1085+
1086+
static int arm_restart(struct notifier_block *nb, unsigned long action,
1087+
void *data)
1088+
{
1089+
__arm_pm_restart(action, data);
1090+
return NOTIFY_DONE;
1091+
}
1092+
1093+
static struct notifier_block arm_restart_nb = {
1094+
.notifier_call = arm_restart,
1095+
.priority = 128,
1096+
};
1097+
10841098
void __init setup_arch(char **cmdline_p)
10851099
{
10861100
const struct machine_desc *mdesc = NULL;
@@ -1149,8 +1163,10 @@ void __init setup_arch(char **cmdline_p)
11491163
kasan_init();
11501164
request_standard_resources(mdesc);
11511165

1152-
if (mdesc->restart)
1153-
arm_pm_restart = mdesc->restart;
1166+
if (mdesc->restart) {
1167+
__arm_pm_restart = mdesc->restart;
1168+
register_restart_handler(&arm_restart_nb);
1169+
}
11541170

11551171
unflatten_device_tree();
11561172

0 commit comments

Comments
 (0)