When doing timekeeping_resume(), if the nonstop clocksource
wraps back, "cycle_delta" will miss the wrap time.

It's hard to determine the right CLOCKSOURCE_MASK(xxx) or
something to add code for inspecting such behavior, and we
don't have many existent nonstop clocksources, so just add
a comment to indicate that if have this flag set, people
are aware that this nonstop clocksource won't wrap back
during system suspend/resume.

Signed-off-by: Xunlei Pang <pang.xun...@linaro.org>
---
 include/linux/clocksource.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index abcafaa..8680189 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -207,6 +207,11 @@ struct clocksource {
 #define CLOCK_SOURCE_WATCHDOG                  0x10
 #define CLOCK_SOURCE_VALID_FOR_HRES            0x20
 #define CLOCK_SOURCE_UNSTABLE                  0x40
+
+/*
+ * When setting this flag, you're also supposed to mean that it doesn't
+ * wrap back during system suspend/resume. See timekeeping_resume().
+ */
 #define CLOCK_SOURCE_SUSPEND_NONSTOP           0x80
 #define CLOCK_SOURCE_RESELECT                  0x100
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to