mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-26 06:33:19 -04:00
FROMLIST: ARM: 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. Bug: 146512338 Change-Id: I1bfa30771cb3d1289177ba86b3378e3f6cd01e1c Link: https://lore.kernel.org/patchwork/patch/1139627/ Acked-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Thierry Reding <treding@nvidia.com>
This commit is contained in:
parent
b0ac347088
commit
390baafa19
1 changed files with 10 additions and 2 deletions
|
|
@ -29,6 +29,7 @@
|
|||
#include <linux/cpu.h>
|
||||
#include <linux/console.h>
|
||||
#include <linux/pvclock_gtod.h>
|
||||
#include <linux/reboot.h>
|
||||
#include <linux/time64.h>
|
||||
#include <linux/timekeeping.h>
|
||||
#include <linux/timekeeper_internal.h>
|
||||
|
|
@ -180,11 +181,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)
|
||||
{
|
||||
|
|
@ -405,7 +413,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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue