Skip to content

reboot-fixes

Eric W. Biederman linux-acpi linux-pm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest23 patches 44 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/23Add missing device_suspsend(PMSG_FREEZE) calls.kernel/sys.c+2 -04 replies
2/23Refactor sys_reboot into reusable partsinclude/linux/reboot.h kernel/sys.c+73 -420 replies
3/23Make ctrl_alt_del call kernel_restart to get a proper reboot.kernel/sys.c+1 -20 replies
4/23Add emergency_restart()include/asm-alpha/emergency-restart.h include/asm-arm/emergency-restart.h include/asm-arm26/emergency-restart.h +24 more+166 -00 replies
5/23Fix the arguments to machine_restart on crisarch/cris/kernel/process.c+2 -10 replies
6/23Don't export machine_restart, machine_halt, or machine_power_off.arch/alpha/kernel/process.c arch/arm/kernel/process.c arch/arm26/kernel/process.c +26 more+0 -1524 replies
7/23i386: Implement machine_emergency_rebootarch/i386/kernel/reboot.c include/asm-i386/emergency-restart.h+8 -40 replies
8/23x86_64: Fix reboot_forcearch/x86_64/kernel/reboot.c+1 -80 replies
9/23x86_64: Implemenent machine_emergency_restartarch/x86_64/kernel/reboot.c include/asm-x86_64/emergency-restart.h+12 -80 replies
10/23Use kernel_power_off in sysrq-okernel/power/poweroff.c+2 -20 replies
11/23Call emergency_reboot from panickernel/panic.c+4 -50 replies
12/23Update sysrq-B to use emergency_restart()drivers/char/sysrq.c+1 -10 replies
13/23Fix watchdog drivers to call emergency_reboot()drivers/char/watchdog/eurotechwdt.c drivers/char/watchdog/softdog.c drivers/char/watchdog/wdt.c +1 more+4 -40 replies
14/23In hangcheck-timer.c call emergency_restart()drivers/char/hangcheck-timer.c+1 -10 replies
15/2368328serial: sysrq should use emergency_rebootdrivers/serial/68328serial.c+1 -10 replies
16/23swpsuspend: Have suspend to disk use factors of sys_rebootkernel/power/disk.c+3 -62 replies
17/23pcwd.c: Call kernel_power_off not machine_power_offdrivers/char/watchdog/pcwd.c+2 -20 replies
18/23machine_shutdown: Typo fix to actually allow specifying which cpu to reboot onarch/i386/kernel/reboot.c+1 -10 replies
19/23i386 machine_power_off cleanuparch/i386/kernel/reboot.c+1 -30 replies
20/23APM: Remove redundant call to set_cpus_allowedarch/i386/kernel/apm.c+0 -70 replies
21/23x86_64 sync machine_power_off with i386arch/x86_64/kernel/reboot.c+3 -00 replies
22/23acpi_power_off: Don't switch to the boot cpudrivers/acpi/sleep/poweroff.c+0 -10 replies
23/23acpi: Don't call acpi_sleep_prepare from acpi_power_offdrivers/acpi/sleep/poweroff.c+12 -210 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/23] reboot-fixes

The reboot code paths seems to be suffering from 15 years of people only looking at the code when it breaks. The result is there are several code paths in which different callers expect different semantics from the same functions, and a fair amount of imperfect inline replication of code.

For a year or more every time I fix one bug in the bug fix reveals yet another bug. In an attempt to end the cycle of bug fixes revealing yet more bugs I have generated a series of patches to clean up the semantics along the reboot path.

With the callers all agreeing on what to expect from the functions they call it should at least be possible to kill bugs without more showing up because of the bug fix.

My primary approach is to factor sys_reboot into several smaller functions and provide those functions for the general kernel consumers instead of the architecture dependent restart and halt hooks.

I don't expect this to noticeably fix any bugs along the main code paths but magic sysrq and several of the more obscure code paths should work much more reliably.

Eric