]> www.infradead.org Git - users/hch/xfs.git/commit
PM: sleep: core: Synchronize runtime PM status of parents and children
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 28 Jan 2025 19:24:41 +0000 (20:24 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 29 Jan 2025 10:50:33 +0000 (11:50 +0100)
commit3775fc538f535a7c5adaf11990c7932a0bd1f9eb
tree6d572cfa6648ff5bc512528ffd7def77a3b5bdde
parent4891cd3eba62ac611a7929948cf5588a1abed909
PM: sleep: core: Synchronize runtime PM status of parents and children

Commit 6e176bf8d461 ("PM: sleep: core: Do not skip callbacks in the
resume phase") overlooked the case in which the parent of a device with
DPM_FLAG_SMART_SUSPEND set did not use that flag and could be runtime-
suspended before a transition into a system-wide sleep state.  In that
case, if the child is resumed during the subsequent transition from
that state into the working state, its runtime PM status will be set to
RPM_ACTIVE, but the runtime PM status of the parent will not be updated
accordingly, even though the parent will be resumed too, because of the
dev_pm_skip_suspend() check in device_resume_noirq().

Address this problem by tracking the need to set the runtime PM status
to RPM_ACTIVE during system-wide resume transitions for devices with
DPM_FLAG_SMART_SUSPEND set and all of the devices depended on by them.

Fixes: 6e176bf8d461 ("PM: sleep: core: Do not skip callbacks in the resume phase")
Closes: https://lore.kernel.org/linux-pm/Z30p2Etwf3F2AUvD@hovoldconsulting.com/
Reported-by: Johan Hovold <johan@kernel.org>
Tested-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
Tested-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://patch.msgid.link/12619233.O9o76ZdvQC@rjwysocki.net
drivers/base/power/main.c
include/linux/pm.h