pm: runtime: fix timer_expires on 32bits arch
Subsystems (3)
PATCH 1/1 pm: runtime: fix timer_expires on 32bits arch
The commit 8234f6734c5d ("PM-runtime: Switch autosuspend over to using hrtimers") switched PM runtime autosuspend to use hrtimers and all related time accounting in ns, but missed update the struct dev_pm_info->timer_expires to u64. This causes timer_expires value to be truncated on 32bits architectures when assignment is done from u64 values:
rpm_suspend()
|- dev->power.timer_expires = expires;
Hence, fix it by changing timer_expires type to u64.
--- include/linux/pm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/pm.h +1 -1
@@ -590,7 +590,7 @@ struct dev_pm_info {#endif #ifdef CONFIG_PM struct hrtimer suspend_timer; -unsigned long timer_expires; +u64 timer_expires;struct work_struct work;wait_queue_head_t wait_queue;struct wake_irq *wakeirq;
Signature · 1 line
2.17.1
Quoted 6 lines · Grygorii Strashko
The commit
8234f6734c5d("PM-runtime: Switch autosuspend over to using hrtimers") switched PM runtime autosuspend to use hrtimers and all related time accounting in ns, but missed update the structdev_pm_info->timer_expiresto u64. This causestimer_expiresvalue to be truncated on 32bits architectures when assignment is done from u64 values:
Quoted 8 lines
rpm_suspend()
|-dev->power.timer_expires= expires;Hence, fix it by changing
timer_expirestype to u64.Cc Vincent Guittot <[email protected]>Fixes 8234f6734c5d ("PM-runtime: Switch autosuspend over to using hrtimers")Signed-off-by Grygorii Strashko <[email protected]>
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 7 lines · Grygorii Strashko
The commit
8234f6734c5d("PM-runtime: Switch autosuspend over to using hrtimers") switched PM runtime autosuspend to use hrtimers and all related time accounting in ns, but missed update the structdev_pm_info->timer_expiresto u64. This causestimer_expiresvalue to be truncated on 32bits architectures when assignment is done from u64 values:
Quoted 8 lines
rpm_suspend()
|-dev->power.timer_expires= expires;Hence, fix it by changing
timer_expirestype to u64.Cc Vincent Guittot <[email protected]>Fixes 8234f6734c5d ("PM-runtime: Switch autosuspend over to using hrtimers")Signed-off-by Grygorii Strashko <[email protected]>
Quoted 20 lines
--- include/linux/pm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/linux/pm.h +1
-2@@ -590,7 +590,7 @@ struct dev_pm_info {#endif #ifdef CONFIG_PM struct hrtimer suspend_timer; -unsigned long timer_expires; +u64 timer_expires;struct work_struct work;wait_queue_head_t wait_queue;struct wake_irq *wakeirq; --2.17.1
Quoted 13 lines · Vincent Guittot
Quoted 10 lines · Grygorii Strashko
The commit
8234f6734c5d("PM-runtime: Switch autosuspend over to using hrtimers") switched PM runtime autosuspend to use hrtimers and all related time accounting in ns, but missed update the structdev_pm_info->timer_expiresto u64. This causestimer_expiresvalue to be truncated on 32bits architectures when assignment is done from u64 values:
rpm_suspend()
|-dev->power.timer_expires= expires;
Quoted 7 lines
Quoted 5 lines
Hence, fix it by changing
timer_expirestype to u64.Cc Vincent Guittot <[email protected]>Fixes 8234f6734c5d ("PM-runtime: Switch autosuspend over to using hrtimers")Signed-off-by Grygorii Strashko <[email protected]>Acked-by Vincent Guittot <[email protected]>
Applied as 5.9-rc7 material with some edits in the subject and changelog, thanks!
Quoted 20 lines
Quoted 20 lines
--- include/linux/pm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/linux/pm.h +1
-2@@ -590,7 +590,7 @@ struct dev_pm_info {#endif #ifdef CONFIG_PM struct hrtimer suspend_timer; -unsigned long timer_expires; +u64 timer_expires;struct work_struct work;wait_queue_head_t wait_queue;struct wake_irq *wakeirq; --2.17.1