16 Apr, 2015

1 commit

  • The kernel has orderly_poweroff which allows the kernel to initiate a
    graceful shutdown of userspace, by running /sbin/poweroff. This adds
    orderly_reboot that will cause userspace to shut itself down by calling
    /sbin/reboot.

    This will be used for shutdown initiated by a system controller on
    platforms that do not use ACPI.

    orderly_reboot() should be used when the system wants to allow userspace
    to gracefully shut itself down. For cases where the system may imminently
    catch on fire, the existing emergency_restart() provides an immediate
    reboot without involving userspace.

    Signed-off-by: Joel Stanley
    Cc: Fabian Frederick
    Cc: Benjamin Herrenschmidt
    Cc: Michael Ellerman
    Cc: Rusty Russell
    Cc: Jeremy Kerr
    Cc: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joel Stanley
     

26 Sep, 2014

1 commit

  • 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
    Acked-by: Catalin Marinas
    Acked-by: Heiko Stuebner
    Cc: Russell King
    Cc: Wim Van Sebroeck
    Cc: Maxime Ripard
    Cc: Will Deacon
    Cc: Arnd Bergmann
    Cc: Jonas Jensen
    Cc: Randy Dunlap
    Cc: Steven Rostedt
    Cc: Ingo Molnar
    Cc: Dmitry Eremin-Solenikov
    Cc: David Woodhouse
    Cc: Tomasz Figa
    Signed-off-by: Andrew Morton

    Guenter Roeck
     

05 Jun, 2014

1 commit


19 Dec, 2013

1 commit

  • Commit 1b3a5d02ee07 ("reboot: move arch/x86 reboot= handling to generic
    kernel") moved reboot= handling to generic code. In the process it also
    removed the code in native_machine_shutdown() which are moving reboot
    process to reboot_cpu/cpu0.

    I guess that thought must have been that all reboot paths are calling
    migrate_to_reboot_cpu(), so we don't need this special handling. But
    kexec reboot path (kernel_kexec()) is not calling
    migrate_to_reboot_cpu() so above change broke kexec. Now reboot can
    happen on non-boot cpu and when INIT is sent in second kerneo to bring
    up BP, it brings down the machine.

    So start calling migrate_to_reboot_cpu() in kexec reboot path to avoid
    this problem.

    Bisected by WANG Chao.

    Reported-by: Matthew Whitehead
    Reported-by: Dave Young
    Signed-off-by: Vivek Goyal
    Tested-by: Baoquan He
    Tested-by: WANG Chao
    Acked-by: H. Peter Anvin
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vivek Goyal
     

25 Sep, 2013

1 commit

  • Commit 1b3a5d02ee07 ("reboot: move arch/x86 reboot= handling to generic
    kernel") did some cleanup for reboot= command line, but it made the
    reboot_default inoperative.

    The default value of variable reboot_default should be 1, and if command
    line reboot= is not set, system will use the default reboot mode.

    [akpm@linux-foundation.org: fix comment layout]
    Signed-off-by: Li Fei
    Signed-off-by: liu chuansheng
    Acked-by: Robin Holt
    Cc: [3.11.x]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chuansheng Liu
     

10 Jul, 2013

3 commits