PM / Domains: Skip timings during syscore suspend/resume
authorGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 29 May 2015 15:24:23 +0000 (17:24 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 15 Jun 2015 20:36:02 +0000 (22:36 +0200)
commita4630c61274322eda7c4a4d17051f7c72a9e03b1
tree19f28cfbff63e19e35b0655967b11f1f7165aa9b
parent0f57d86787d8b1076ea8f9cbdddda2a46d534a27
PM / Domains: Skip timings during syscore suspend/resume

The PM Domain code uses ktime_get() to perform various latency
measurements.  However, if ktime_get() is called while timekeeping is
suspended, the following warning is printed:

    WARNING: CPU: 0 PID: 1340 at kernel/time/timekeeping.c:576 ktime_get+0x3

This happens when resuming the PM Domain that contains the clock events
source, which calls pm_genpd_syscore_poweron(). Chain of operations is:

    timekeeping_resume()
    {
clockevents_resume()
    sh_cmt_clock_event_resume()
pm_genpd_syscore_poweron()
    pm_genpd_sync_poweron()
genpd_syscore_switch()
    genpd_power_on()
ktime_get(), but timekeeping_suspended == 1
...
timekeeping_suspended = 0;
    }

Fix this by adding a "timed" parameter to genpd_power_{on,off}() and
pm_genpd_sync_power{off,on}(), to indicate whether latency measurements
are allowed.  This parameter is passed as false in
genpd_syscore_switch() (i.e. during syscore suspend/resume), and true in
all other cases.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/domain.c