linux/drivers/base
Rafael J. Wysocki ebd6884167 PM: sleep: Update power.completion for all devices on errors
After commit aa7a9275ab ("PM: sleep: Suspend async parents after
suspending children"), the following scenario is possible:

 1. Device A is async and it depends on device B that is sync.
 2. Async suspend is scheduled for A before the processing of B is
    started.
 3. A is waiting for B.
 4. In the meantime, an unrelated device fails to suspend and returns
    an error.
 5. The processing of B doesn't start at all and its power.completion is
    not updated.
 6. A is still waiting for B when async_synchronize_full() is called.
 7. Deadlock ensues.

To prevent this from happening, update power.completion for all devices
on errors in all suspend phases, but do not do it directly for devices
that are already being processed or are waiting for the processing to
start because in those cases it may be necessary to wait for the
processing to actually complete before updating power.completion for
the device.

Fixes: aa7a9275ab ("PM: sleep: Suspend async parents after suspending children")
Fixes: 443046d1ad ("PM: sleep: Make suspend of devices more asynchronous")
Closes: https://lore.kernel.org/linux-pm/e13740a0-88f3-4a6f-920f-15805071a7d6@linaro.org/
Reported-and-tested-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://patch.msgid.link/6191258.lOV4Wx5bFT@rjwysocki.net
2025-07-15 14:55:11 +02:00
..
firmware_loader firmware_loader: use SHA-256 library API instead of crypto_shash API 2025-04-30 21:55:54 +02:00
power PM: sleep: Update power.completion for all devices on errors 2025-07-15 14:55:11 +02:00
regmap regmap: irq: Add support for chips without separate IRQ status 2025-05-22 13:11:50 +01:00
test
Kconfig
Makefile
arch_numa.c
arch_topology.c arch_topology: Relocate cpu_scale to topology.[h|c] 2025-05-07 21:56:55 +02:00
attribute_container.c
auxiliary.c Linux 6.15-rc4 2025-04-28 09:51:34 +02:00
auxiliary_sysfs.c
base.h driver core: fix potential NULL pointer dereference in dev_uevent() 2025-04-15 17:04:35 +02:00
bus.c driver core: fix potential NULL pointer dereference in dev_uevent() 2025-04-15 17:04:35 +02:00
cacheinfo.c
class.c
component.c component: do not try to unbind unbound components 2025-04-15 18:05:40 +02:00
container.c
core.c driver core: fix potential NULL pointer dereference in dev_uevent() 2025-04-15 17:04:35 +02:00
cpu.c x86/bugs: Add a Transient Scheduler Attacks mitigation 2025-06-17 17:17:02 +02:00
dd.c driver core: introduce device_set_driver() helper 2025-04-15 17:04:35 +02:00
devcoredump.c
devres.c Immutable tag for the driver core tree to pull from 2025-04-28 10:18:29 +02:00
devtmpfs.c devtmpfs: don't use vfs_getattr_nosec to query i_mode 2025-04-25 12:11:45 +02:00
driver.c
faux.c driver core: faux: Quiet probe failures 2025-06-10 19:23:25 +02:00
firmware.c
hypervisor.c
init.c
isa.c
map.c
memory.c memory: implement memory_block_advise/probe_max_size 2025-05-11 17:48:07 -07:00
module.c drivers: base: handle module_kobject creation 2025-04-16 15:10:55 +02:00
node.c - The 11 patch series "Add folio_mk_pte()" from Matthew Wilcox 2025-05-31 15:44:16 -07:00
physical_location.c
physical_location.h
pinctrl.c
platform-msi.c platform-msi: Add msi_remove_device_irq_domain() in platform_device_msi_free_irqs_all() 2025-05-07 17:49:00 +02:00
platform.c Merge 6.15-rc6 into driver-core-next 2025-05-12 14:16:34 +02:00
property.c Char/Misc/IIO pull request for 6.16-rc1 2025-06-06 11:50:47 -07:00
soc.c
swnode.c Linux 6.15-rc4 2025-04-28 09:51:34 +02:00
syscore.c
topology.c arch_topology: Relocate cpu_scale to topology.[h|c] 2025-05-07 21:56:55 +02:00
trace.c
trace.h
transport_class.c