diff options
author | Guenter Roeck <[email protected]> | 2014-09-26 00:03:16 +0000 |
---|---|---|
committer | Guenter Roeck <[email protected]> | 2014-09-26 00:00:06 -0700 |
commit | b63adb979583ef185718d774d8162387db5589c0 (patch) | |
tree | e6467352881135f82037829ecdd204489fbad415 /net/lapb/lapb_subr.c | |
parent | 52addcf9d6669fa439387610bc65c92fa0980cef (diff) |
kernel: add support for kernel restart handler call chain
Various drivers implement architecture and/or device specific means to
restart (reset) the system. Various mechanisms have been implemented to
support those schemes. The best known mechanism is arm_pm_restart, which
is a function pointer to be set either from platform specific code or from
drivers. Another mechanism is to use hardware watchdogs to issue a reset;
this mechanism is used if there is no other method available to reset a
board or system. Two examples are alim7101_wdt, which currently uses the
reboot notifier to trigger a reset, and moxart_wdt, which registers the
arm_pm_restart function.
The existing mechanisms have a number of drawbacks. Typically only one
scheme to restart the system is supported (at least if arm_pm_restart is
used). At least in theory there can be multiple means to restart the
system, some of which may be less desirable (for example one mechanism may
only reset the CPU, while another may reset the entire system). Using
arm_pm_restart can also be racy if the function pointer is set from a
driver, as the driver may be in the process of being unloaded when
arm_pm_restart is called. Using the reboot notifier is always racy, as it
is unknown if and when other functions using the reboot notifier have
completed execution by the time the watchdog fires.
Introduce a system restart handler call chain to solve the described
problems. This call chain is expected to be executed from the
architecture specific machine_restart() function. Drivers providing
system restart functionality (such as the watchdog drivers mentioned
above) are expected to register with this call chain. By using the
priority field in the notifier block, callers can control restart handler
execution sequence and thus ensure that the restart handler with the
optimal restart capabilities for a given system is called first.
Signed-off-by: Guenter Roeck <[email protected]>
Acked-by: Catalin Marinas <[email protected]>
Acked-by: Heiko Stuebner <[email protected]>
Cc: Russell King <[email protected]>
Cc: Wim Van Sebroeck <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Jonas Jensen <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Dmitry Eremin-Solenikov <[email protected]>
Cc: David Woodhouse <[email protected]>
Cc: Tomasz Figa <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'net/lapb/lapb_subr.c')
0 files changed, 0 insertions, 0 deletions