aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <[email protected]>2025-03-13 16:00:00 +0000
committerRafael J. Wysocki <[email protected]>2025-03-14 13:02:14 +0000
commit03f1444016b71feffa1dfb8a51f15ba592f94b13 (patch)
tree1c1925337601d643cc0837a0e77c61b9b3191393 /net/unix/af_unix.c
parentPM: sleep: core: Fix indentation in dpm_wait_for_children() (diff)
downloadkernel-03f1444016b71feffa1dfb8a51f15ba592f94b13.tar.gz
kernel-03f1444016b71feffa1dfb8a51f15ba592f94b13.zip
PM: sleep: Fix handling devices with direct_complete set on errors
When dpm_suspend() fails, some devices with power.direct_complete set may not have been handled by device_suspend() yet, so runtime PM has not been disabled for them yet even though power.direct_complete is set. Since device_resume() expects that runtime PM has been disabled for all devices with power.direct_complete set, it will attempt to reenable runtime PM for the devices that have not been processed by device_suspend() which does not make sense. Had those devices had runtime PM disabled before device_suspend() had run, device_resume() would have inadvertently enable runtime PM for them, but this is not expected to happen because it would require ->prepare() callbacks to return positive values for devices with runtime PM disabled, which would be invalid. In practice, this issue is most likely benign because pm_runtime_enable() will not allow the "disable depth" counter to underflow, but it causes a warning message to be printed for each affected device. To allow device_resume() to distinguish the "direct complete" devices that have been processed by device_suspend() from those which have not been handled by it, make device_suspend() set power.is_suspended for "direct complete" devices. Next, move the power.is_suspended check in device_resume() before the power.direct_complete check in it to make it skip the "direct complete" devices that have not been handled by device_suspend(). This change is based on a preliminary patch from Saravana Kannan. Fixes: aae4518b3124 ("PM / sleep: Mechanism to avoid resuming runtime-suspended devices unnecessarily") Link: https://lore.kernel.org/linux-pm/[email protected]/ Reported-by: Saravana Kannan <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Saravana Kannan <[email protected]> Link: https://patch.msgid.link/[email protected]
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions