PM-runtime: Fix autosuspend_delay on 32bits arch
authorVincent Guittot <vincent.guittot@linaro.org>
Thu, 10 Jan 2019 09:00:40 +0000 (10:00 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 10 Jan 2019 09:55:52 +0000 (10:55 +0100)
commitca27e4cd0bdd87e33fda38e6e3d18d36d54356d4
tree49bd82769e80a8965b392052f744057830aefa9a
parent1f7b7081568bca281f4ef42096206180cfaced00
PM-runtime: Fix autosuspend_delay on 32bits arch

Cast autosuspend_delay to u64 to make sure that the full computation
of 'expires' or slack will be done in u64, even on 32bits arch.

Otherwise, any delay greater than 2^31 nsec can overflow if signed
32bits is used when converting delay from msec to nsec.

Fixes: 8234f6734c5d (PM-runtime: Switch autosuspend over to using hrtimers)
Reported-by: Tony Lindgren <tony@atomide.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/runtime.c