linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pm: runtime: fix timer_expires on 32bits arch
@ 2020-09-18 16:55 Grygorii Strashko
  2020-09-18 20:56 ` Pavel Machek
  2020-09-21  6:51 ` Vincent Guittot
  0 siblings, 2 replies; 4+ messages in thread
From: Grygorii Strashko @ 2020-09-18 16:55 UTC (permalink / raw)
  To: Rafael J. Wysocki, linux-pm, Ulf Hansson, Vincent Guittot
  Cc: Len Brown, Pavel Machek, linux-kernel, 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 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.

Cc: Vincent Guittot <vincent.guittot@linaro.org>
Fixes: 8234f6734c5d ("PM-runtime: Switch autosuspend over to using hrtimers")
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 include/linux/pm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/pm.h b/include/linux/pm.h
index a30a4b54df52..47aca6bac1d6 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-21 14:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18 16:55 [PATCH] pm: runtime: fix timer_expires on 32bits arch Grygorii Strashko
2020-09-18 20:56 ` Pavel Machek
2020-09-21  6:51 ` Vincent Guittot
2020-09-21 14:15   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).