[PATCH v2 3/3] PM: hibernate: log the task that initiated the power down
Bradley Morgan <[email protected]> Tue, 21 Jul 2026 16:13:58 +0100
| Newsgroups | org.infradead.lists.kexec,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pm |
|---|---|
| Message-ID | <[email protected]> |
Give the hibernation power down the same treatment as the reboot syscall commands. hibernate() runs in the context of the task that asked for it, whether through the reboot syscall or a write to /sys/power/disk, so when power_down() runs current is still the initiating task. Log it once the image has been written and the machine is committed to going down: reboot: initiated by systemd-sleep[812] reboot: Power down The line comes from kernel/reboot.c so it keeps the "reboot:" prefix and sits right next to the final "Restarting system", "Power down" or "System halted" line, same as a plain reboot. The one exception is platform mode rolling back on a pending wakeup event after the line has been printed. The existing "Wakeup event detected during hibernation, rolling back." line follows immediately in that case, so the log stays real about what happened. Signed-off-by: Bradley Morgan <[email protected]> --- kernel/power/hibernate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index d2479c69d71a..bec91bf6a63c 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c @@ -687,6 +687,8 @@ static void power_down(void) } #endif + reboot_log_initiator(); + switch (hibernation_mode) { case HIBERNATION_REBOOT: kernel_restart(NULL); -- 2.50.1