From cfca563bc1d851a2bd6361ee0710c9b4ac71f44b Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Fri, 4 Jun 2021 15:07:33 +0100 Subject: ARM: 9092/1: xen: Register with kernel restart handler Register with kernel restart handler instead of setting arm_pm_restart directly. Select a high priority of 192 to ensure that default restart handlers are replaced if Xen is running. Acked-by: Arnd Bergmann Reviewed-by: Wolfram Sang Reviewed-by: Stefano Stabellini Signed-off-by: Guenter Roeck Signed-off-by: Thierry Reding Signed-off-by: Lee Jones Signed-off-by: Russell King --- arch/arm/xen/enlighten.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'arch/arm/xen') diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 8ad576ecd0f1..7f1c106b746f 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -181,11 +182,18 @@ void xen_reboot(int reason) BUG_ON(rc); } -static void xen_restart(enum reboot_mode reboot_mode, const char *cmd) +static int xen_restart(struct notifier_block *nb, unsigned long action, + void *data) { xen_reboot(SHUTDOWN_reboot); + + return NOTIFY_DONE; } +static struct notifier_block xen_restart_nb = { + .notifier_call = xen_restart, + .priority = 192, +}; static void xen_power_off(void) { @@ -404,7 +412,7 @@ static int __init xen_pm_init(void) return -ENODEV; pm_power_off = xen_power_off; - arm_pm_restart = xen_restart; + register_restart_handler(&xen_restart_nb); if (!xen_initial_domain()) { struct timespec64 ts; xen_read_wallclock(&ts); -- cgit