twx-linux/kernel/power
Wentao Liang 02794e35ab PM: hibernate: Add error handling for syscore_suspend()
[ Upstream commit e20a70c572539a486dbd91b225fa6a194a5e2122 ]

In hibernation_platform_enter(), the code did not check the
return value of syscore_suspend(), potentially leading to a
situation where syscore_resume() would be called even if
syscore_suspend() failed. This could cause unpredictable
behavior or system instability.

Modify the code sequence in question to properly handle errors returned
by syscore_suspend(). If an error occurs in the suspend path, the code
now jumps to label 'Enable_irqs' skipping the syscore_resume() call and
only enabling interrupts after setting the system state to SYSTEM_RUNNING.

Fixes: 40dc166cb5dd ("PM / Core: Introduce struct syscore_ops for core subsystems PM")
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20250119143205.2103-1-vulab@iscas.ac.cn
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-02-08 09:52:29 +01:00
..
autosleep.c
console.c
energy_model.c PM: EM: fix memory leak with using debugfs_lookup() 2023-02-09 20:36:10 +01:00
hibernate.c PM: hibernate: Add error handling for syscore_suspend() 2025-02-08 09:52:29 +01:00
Kconfig PM: sleep: Remove "select SRCU" 2023-01-20 17:53:07 +01:00
main.c - Yosry Ahmed brought back some cgroup v1 stats in OOM logs. 2023-06-28 10:28:11 -07:00
Makefile
power.h PM: hibernate: Rename function parameter from snapshot_test to exclusive 2023-09-12 11:45:15 +02:00
poweroff.c tty: sysrq: switch sysrq handlers from int to u8 2023-07-25 19:21:03 +02:00
process.c workqueue: Introduce show_freezable_workqueues 2023-03-23 15:55:38 -10:00
qos.c PM: QoS: Add check to make sure CPU latency is non-negative 2023-08-22 21:37:29 +02:00
snapshot.c PM: hibernate: Clean up sync_read handling in snapshot_write_next() 2023-11-28 17:20:02 +00:00
suspend_test.c
suspend.c PM: s2idle: Make sure CPUs will wakeup directly on resume 2024-04-17 11:19:26 +02:00
swap.c PM: hibernate: Enforce ordering during image compression/decompression 2024-01-31 16:18:49 -08:00
user.c
wakelock.c