msm-4.14/include/linux/sched_clock.h
Stephen Boyd 12242fff55 timers, sched/clock: Hook into s2idle freeze path
The sched_clock() suspend/resume callbacks are called from a
syscore_ops structure that's registered after the timekeeping
syscore_ops. With the suspend-to-idle method of suspend we will
freeze the tick and timekeeping subsystem, but we don't suspend
the sched clock here, because syscore ops are not called in
suspend to idle. Hook this up directly in the timekeeping freeze
path when we go idle on the last CPU. This way, the sched clock
doesn't jump across a suspend/resume cycle.

Change-Id: I2ea488dce7186d6210d3af34b0e1a67c9f1cdf78
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
2018-07-12 17:17:29 +05:30

31 lines
843 B
C

/*
* sched_clock.h: support for extending counters to full 64-bit ns counter
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef LINUX_SCHED_CLOCK
#define LINUX_SCHED_CLOCK
#ifdef CONFIG_GENERIC_SCHED_CLOCK
extern void sched_clock_postinit(void);
extern void sched_clock_register(u64 (*read)(void), int bits,
unsigned long rate);
extern int sched_clock_suspend(void);
extern void sched_clock_resume(void);
#else
static inline void sched_clock_postinit(void) { }
static inline void sched_clock_register(u64 (*read)(void), int bits,
unsigned long rate)
{
;
}
static inline int sched_clock_suspend(void) { return 0; }
static inline void sched_clock_resume(void) { }
#endif
#endif