linux/drivers/base
Rafael J. Wysocki f384497a76 PM: sleep: core: Fix runtime PM enabling in device_resume_early()
Runtime PM should only be enabled in device_resume_early() if it has
been disabled for the given device by device_suspend_late().  Otherwise,
it may cause runtime PM callbacks to run prematurely in some cases
which leads to further functional issues.

Make two changes to address this problem.

First, reorder device_suspend_late() to only disable runtime PM for a
device when it is going to look for the device's callback or if the
device is a "syscore" one.  In all of the other cases, disabling runtime
PM for the device is not in fact necessary.  However, if the device's
callback returns an error and the power.is_late_suspended flag is not
going to be set, enable runtime PM so it only remains disabled when
power.is_late_suspended is set.

Second, make device_resume_early() only enable runtime PM for the
devices with the power.is_late_suspended flag set.

Fixes: 443046d1ad ("PM: sleep: Make suspend of devices more asynchronous")
Reported-by: Rose Wu <ya-jou.wu@mediatek.com>
Closes: https://lore.kernel.org/linux-pm/70b25dca6f8c2756d78f076f4a7dee7edaaffc33.camel@mediatek.com/
Cc: 6.16+ <stable@vger.kernel.org> # 6.16+
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/12784270.O9o76ZdvQC@rafael.j.wysocki
2025-11-18 15:47:55 +01:00
..
firmware_loader Driver core changes for 6.17-rc1 2025-07-29 12:15:39 -07:00
power PM: sleep: core: Fix runtime PM enabling in device_resume_early() 2025-11-18 15:47:55 +01:00
regmap regmap: slimbus: fix bus_context pointer in regmap init calls 2025-10-23 15:19:58 +01:00
test
Kconfig PM: runtime: Add basic kunit tests for API contracts 2025-09-27 13:41:47 +02:00
Makefile
arch_numa.c
arch_topology.c arch_topology: Fix incorrect error check in topology_parse_cpu_capacity() 2025-10-22 08:06:28 +02:00
attribute_container.c
auxiliary.c driver core: auxiliary bus: Optimize logic of auxiliary_match_id() 2025-09-06 20:12:36 +02:00
auxiliary_sysfs.c
base.h PM: sleep: Do not wait on SYNC_STATE_ONLY device links 2025-09-27 14:10:51 +02:00
bus.c
cacheinfo.c
class.c
component.c
container.c
core.c driver core: fw_devlink: Don't warn about sync_state() pending 2025-10-17 09:47:40 +02:00
cpu.c Merge 6.17-rc6 into driver-core-next 2025-09-15 08:26:05 +02:00
dd.c
devcoredump.c devcoredump: Fix circular locking dependency with devcd->mutex. 2025-10-17 09:47:40 +02:00
devres.c devres: provide devm_kmemdup_const() 2025-09-08 14:21:23 +02:00
devtmpfs.c VFS: rename kern_path_locked() and related functions. 2025-09-23 12:37:36 +02:00
driver.c
faux.c driver core: faux: Set power.no_pm for faux devices 2025-09-06 13:58:00 +02:00
firmware.c
hypervisor.c
init.c
isa.c
map.c
memory.c drivers/base: move memory_block_add_nid() into the caller 2025-10-03 16:42:43 -07:00
module.c
node.c Only two patch series in this pull request: 2025-10-05 12:11:07 -07:00
physical_location.c
physical_location.h
pinctrl.c
platform-msi.c
platform.c
property.c ACPI: Add support for nargs_prop in acpi_fwnode_get_reference_args() 2025-09-25 19:48:47 -06:00
soc.c
swnode.c software node: Constify node_group in registration functions 2025-08-17 13:18:07 +02:00
syscore.c
topology.c
trace.c
trace.h
transport_class.c