linux-yocto/drivers/base/power
Charan Teja Kalla c272bafb0a PM: runtime: fix denying of auto suspend in pm_suspend_timer_fn()
[ Upstream commit 40d3b40dce ]

pm_runtime_put_autosuspend() schedules a hrtimer to expire
at "dev->power.timer_expires". If the hrtimer's callback,
pm_suspend_timer_fn(), observes that the current time equals
"dev->power.timer_expires", it unexpectedly bails out instead of
proceeding with runtime suspend.

pm_suspend_timer_fn():

 if (expires > 0 && expires < ktime_get_mono_fast_ns()) {
 	dev->power.timer_expires = 0;
 	rpm_suspend(..)
 }

Additionally, as ->timer_expires is not cleared, all the future auto
suspend requests will not schedule hrtimer to perform auto suspend.

rpm_suspend():

 if ((rpmflags & RPM_AUTO) &&...) {
 	if (!(dev->power.timer_expires && ...) { <-- this will fail.
 		hrtimer_start_range_ns(&dev->power.suspend_timer,...);
 	}
 }

Fix this by as well checking if current time reaches the set expiration.

Co-developed-by: Patrick Daly <quic_pdaly@quicinc.com>
Signed-off-by: Patrick Daly <quic_pdaly@quicinc.com>
Signed-off-by: Charan Teja Kalla <quic_charante@quicinc.com>
Link: https://patch.msgid.link/20250515064125.1211561-1-quic_charante@quicinc.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-06-27 11:07:32 +01:00
..
clock_ops.c
common.c
domain_governor.c
domain.c pmdomain: core: Fix error checking in genpd_dev_pm_attach_by_id() 2025-06-27 11:07:20 +01:00
generic_ops.c
main.c PM: sleep: Fix power.is_suspended cleanup for direct-complete devices 2025-06-27 11:07:18 +01:00
Makefile
power.h
qos-test.c
qos.c
runtime.c PM: runtime: fix denying of auto suspend in pm_suspend_timer_fn() 2025-06-27 11:07:32 +01:00
sysfs.c
trace.c
wakeirq.c PM: sleep: wakeirq: fix wake irq warning in system suspend 2024-04-03 15:19:30 +02:00
wakeup_stats.c
wakeup.c