aboutsummaryrefslogtreecommitdiffstats
path: root/rust/helpers/helpers.c
diff options
context:
space:
mode:
authorCharan Teja Kalla <[email protected]>2025-05-15 06:41:25 +0000
committerRafael J. Wysocki <[email protected]>2025-05-16 20:05:43 +0000
commit40d3b40dce375d6f1c1dbf08d79eed3aed6c691d (patch)
tree85d2b08d95d5f0787d361628ddfda0f43d382136 /rust/helpers/helpers.c
parentPM: sysfs: Move debug runtime PM attributes to runtime_attrs[] (diff)
downloadkernel-40d3b40dce375d6f1c1dbf08d79eed3aed6c691d.tar.gz
kernel-40d3b40dce375d6f1c1dbf08d79eed3aed6c691d.zip
PM: runtime: fix denying of auto suspend in pm_suspend_timer_fn()
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 <[email protected]> Signed-off-by: Patrick Daly <[email protected]> Signed-off-by: Charan Teja Kalla <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]>
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions