Commit 1a9607a3 authored by Guenter Roeck's avatar Guenter Roeck

arm: support restart through restart handler call chain

The kernel core now supports a restart handler call chain for system
restart functions.

With this change, the arm_pm_restart callback is now optional, so drop its
initialization and check if it is set before calling it.  Only call the
kernel restart handler if arm_pm_restart is not set.
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Acked-by: default avatarHeiko Stuebner <heiko@sntech.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jonas Jensen <jonas.jensen@gmail.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Tomasz Figa <t.figa@samsung.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Wim Van Sebroeck <wim@iguana.be>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 1c7ffc32
...@@ -114,17 +114,13 @@ void soft_restart(unsigned long addr) ...@@ -114,17 +114,13 @@ void soft_restart(unsigned long addr)
BUG(); BUG();
} }
static void null_restart(enum reboot_mode reboot_mode, const char *cmd)
{
}
/* /*
* Function pointers to optional machine specific functions * Function pointers to optional machine specific functions
*/ */
void (*pm_power_off)(void); void (*pm_power_off)(void);
EXPORT_SYMBOL(pm_power_off); EXPORT_SYMBOL(pm_power_off);
void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd) = null_restart; void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);
EXPORT_SYMBOL_GPL(arm_pm_restart); EXPORT_SYMBOL_GPL(arm_pm_restart);
/* /*
...@@ -230,7 +226,10 @@ void machine_restart(char *cmd) ...@@ -230,7 +226,10 @@ void machine_restart(char *cmd)
local_irq_disable(); local_irq_disable();
smp_send_stop(); smp_send_stop();
arm_pm_restart(reboot_mode, cmd); if (arm_pm_restart)
arm_pm_restart(reboot_mode, cmd);
else
do_kernel_restart(cmd);
/* Give a grace period for failure to restart of 1s */ /* Give a grace period for failure to restart of 1s */
mdelay(1000); mdelay(1000);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment