PM-runtime: update accounting_timestamp on enable
authorVincent Guittot <vincent.guittot@linaro.org>
Wed, 23 Jan 2019 07:50:13 +0000 (08:50 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 31 Jan 2019 09:44:44 +0000 (10:44 +0100)
commit58456488e0e3793f2f95a3d2e2a78b6eba0ad0aa
tree177a0ec4de71845192fdbe59aabe2442b673d0db
parent40619f7dd3ef05ae7861bc60d401585d316e1374
PM-runtime: update accounting_timestamp on enable

Initializing accounting_timestamp to something different from 0 during
pm_runtime_init() doesn't make sense and puts an artificial ordering
constraint between timekeeping_init() and pm_runtime_init().

PM-runtime should start time accounting only when it is enabled and
discard the period when disabled.

Set accounting_timestamp to now when enabling PM-runtime.

Suggested-by: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
[ rjw: Subject & changelog ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/runtime.c