linux/drivers/base/power
Rafael J. Wysocki 4e0043a542 PM: sleep: core: Clear power.must_resume in noirq suspend error path
[ Upstream commit be82483d1b ]

If system suspend is aborted in the "noirq" phase (for instance, due to
an error returned by one of the device callbacks), power.is_noirq_suspended
will not be set for some devices and device_resume_noirq() will return
early for them.  Consequently, noirq resume callbacks will not run for
them at all because the noirq suspend callbacks have not run for them
yet.

If any of them has power.must_resume set and late suspend has been
skipped for it (due to power.smart_suspend), early resume should be
skipped for it either, or its state may become inconsistent (for
instance, if the early resume assumes that it will always follow
noirq resume).

Make that happen by clearing power.must_resume in device_resume_noirq()
for devices with power.is_noirq_suspended clear that have been left in
suspend by device_suspend_late(), which will subsequently cause
device_resume_early() to leave the device in suspend and avoid
changing its state.

Fixes: 0d4b54c6fe ("PM / core: Add LEAVE_SUSPENDED driver flag")
Link: https://lore.kernel.org/linux-pm/5d692b81-6f58-4e86-9cb0-ede69a09d799@rowland.harvard.edu/
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://patch.msgid.link/3381776.aeNJFYEL58@rafael.j.wysocki
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-10-15 11:59:58 +02:00
..
clock_ops.c PM: clk: make pm_clk_add_notifier() take a const pointer 2024-01-04 14:35:57 +01:00
common.c PM: domains: Fix alloc/free in dev_pm_domain_attach|detach_list() 2024-10-10 13:55:17 +02:00
generic_ops.c drivers: base: power: add proper SPDX identifiers on files that did not have them. 2019-04-04 20:03:40 +02:00
main.c PM: sleep: core: Clear power.must_resume in noirq suspend error path 2025-10-15 11:59:58 +02:00
Makefile PM: domains: Move genpd and its governor to the pmdomain subsystem 2023-12-18 12:49:48 +01:00
power.h PM: sleep: wakeirq: fix wake irq arming 2023-07-24 09:51:51 +02:00
qos-test.c kunit: allow kunit tests to be loaded as a module 2020-01-09 16:42:29 -07:00
qos.c PM: QoS: Use kcalloc() instead of kzalloc() 2024-01-09 14:55:49 +01:00
runtime.c PM: runtime: Take active children into account in pm_runtime_get_if_in_use() 2025-08-28 16:30:53 +02:00
sysfs.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
trace.c rtc: Extend timeout for waiting for UIP to clear to 1s 2023-12-17 22:33:55 +01:00
wakeirq.c PM: sleep: wakeirq: fix wake irq warning in system suspend 2024-03-05 12:39:05 +01:00
wakeup.c PM: wakeup: make device_wakeup_disable() return void 2024-04-03 16:51:37 +02:00
wakeup_stats.c driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00