[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <5b450836ee0db88de27d47e43368de02c550425b.1528878545.git.baolin.wang@linaro.org>
Date: Wed, 13 Jun 2018 19:32:31 +0800
From: Baolin Wang <baolin.wang@...aro.org>
To: tglx@...utronix.de, john.stultz@...aro.org,
daniel.lezcano@...aro.org, arnd@...db.de, tony@...mide.com,
aaro.koskinen@....fi, linux@...linux.org.uk, mark.rutland@....com,
marc.zyngier@....com
Cc: baolin.wang@...aro.org, broonie@...nel.org,
paulmck@...ux.vnet.ibm.com, mlichvar@...hat.com,
rdunlap@...radead.org, kstewart@...uxfoundation.org,
gregkh@...uxfoundation.org, pombredanne@...b.com,
thierry.reding@...il.com, jonathanh@...dia.com, heiko@...ech.de,
linus.walleij@...aro.org, viresh.kumar@...aro.org,
mingo@...nel.org, hpa@...or.com, peterz@...radead.org,
douly.fnst@...fujitsu.com, len.brown@...el.com,
rajvi.jingar@...el.com, alexandre.belloni@...tlin.com,
x86@...nel.org, linux-arm-kernel@...ts.infradead.org,
linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-omap@...r.kernel.org
Subject: [PATCH 4/8] clocksource: arm_arch_timer: Register the persistent clock
Register the persistent clock to compensate the suspend time for OS time,
if the ARM counter clocksource will not be stopped in suspend state.
Signed-off-by: Baolin Wang <baolin.wang@...aro.org>
---
drivers/clocksource/Kconfig | 1 +
drivers/clocksource/arm_arch_timer.c | 10 ++++++++++
2 files changed, 11 insertions(+)
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 7f11c6c..5e51fcf 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -308,6 +308,7 @@ config ARC_TIMERS_64BIT
config ARM_ARCH_TIMER
bool
+ select PERSISTENT_CLOCK
select TIMER_OF if OF
select TIMER_ACPI if ACPI
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 57cb2f0..671be63 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -32,6 +32,7 @@
#include <asm/virt.h>
#include <clocksource/arm_arch_timer.h>
+#include <linux/persistent_clock.h>
#undef pr_fmt
#define pr_fmt(fmt) "arch_timer: " fmt
@@ -950,6 +951,15 @@ static void __init arch_counter_register(unsigned type)
/* 56 bits minimum, so we assume worst case rollover */
sched_clock_register(arch_timer_read_counter, 56, arch_timer_rate);
+
+ /*
+ * Register the persistent clock if the clocksource will not be stopped
+ * in suspend state.
+ */
+ if (!arch_counter_suspend_stop)
+ persistent_clock_init_and_register(arch_timer_read_counter,
+ CLOCKSOURCE_MASK(56),
+ arch_timer_rate, 0);
}
static void arch_timer_stop(struct clock_event_device *clk)
--
1.7.9.5
Powered by blists - more mailing lists