Skip to content

Commit 6e20602

Browse files
mripardIngo Molnar
authored andcommitted
clocksource/drivers/sun5i: Fix cpufreq interaction with sched_clock()
The sun5i timer is used as the sched-clock on certain systems, and ever since we started using cpufreq, the cpu clock (that is one of the timer's clock indirect parent) now changes as well, along with the actual sched_clock() rate. This is not accurate and not desirable. We can safely remove the sun5i sched-clock on those systems, since we have other reliable sched_clock() sources in the system. Tested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> [ Improved the changelog. ] Cc: richard@nod.at Link: http://lkml.kernel.org/r/1427362029-6511-4-git-send-email-daniel.lezcano@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 11bc26f commit 6e20602

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

drivers/clocksource/timer-sun5i.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include <linux/irq.h>
1818
#include <linux/irqreturn.h>
1919
#include <linux/reset.h>
20-
#include <linux/sched_clock.h>
2120
#include <linux/of.h>
2221
#include <linux/of_address.h>
2322
#include <linux/of_irq.h>
@@ -137,11 +136,6 @@ static struct irqaction sun5i_timer_irq = {
137136
.dev_id = &sun5i_clockevent,
138137
};
139138

140-
static u64 sun5i_timer_sched_read(void)
141-
{
142-
return ~readl(timer_base + TIMER_CNTVAL_LO_REG(1));
143-
}
144-
145139
static void __init sun5i_timer_init(struct device_node *node)
146140
{
147141
struct reset_control *rstc;
@@ -172,7 +166,6 @@ static void __init sun5i_timer_init(struct device_node *node)
172166
writel(TIMER_CTL_ENABLE | TIMER_CTL_RELOAD,
173167
timer_base + TIMER_CTL_REG(1));
174168

175-
sched_clock_register(sun5i_timer_sched_read, 32, rate);
176169
clocksource_mmio_init(timer_base + TIMER_CNTVAL_LO_REG(1), node->name,
177170
rate, 340, 32, clocksource_mmio_readl_down);
178171

0 commit comments

Comments
 (0)