Skip to content

Commit 7eaf8e3

Browse files
author
Thomas Gleixner
committed
Merge tag 'timers-v7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/daniel.lezcano/linux into timers/clocksource
Pull clocksource/events updates from Daniel Lezcano: - Always leave device running after probe in the sh TMU driver to overcome the locking validation scheme warning when the PREEMPT_RT is enabled (Niklas Söderlund) - Add missing Kconfig dependency on OF for the integrator AP (Bartosz Golaszewski) - Fix a dead link in timer bindings for the Armada 370XP (Soham Metha) - Fix an Oops when read_current_timer is called on ARM32 platforms where the SP804 is not registered as the sched_clock (Stephen Eta Zhou) - Move GIC timer to use request_percpu_irq() instead of setup_percpu_irq() to allow the removal of the latter (Marc Zyngier) Link: https://patch.msgid.link/75b163aa-5098-4949-a539-ae1e59e3aaca@linaro.org
2 parents f8f9c1f + a83f9c0 commit 7eaf8e3

5 files changed

Lines changed: 13 additions & 32 deletions

File tree

drivers/clocksource/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ config KEYSTONE_TIMER
254254

255255
config INTEGRATOR_AP_TIMER
256256
bool "Integrator-AP timer driver" if COMPILE_TEST
257+
depends on OF
257258
select CLKSRC_MMIO
258259
help
259260
Enables support for the Integrator-AP timer.

drivers/clocksource/mips-gic-timer.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,6 @@ static irqreturn_t gic_compare_interrupt(int irq, void *dev_id)
7777
return IRQ_HANDLED;
7878
}
7979

80-
static struct irqaction gic_compare_irqaction = {
81-
.handler = gic_compare_interrupt,
82-
.percpu_dev_id = &gic_clockevent_device,
83-
.flags = IRQF_PERCPU | IRQF_TIMER,
84-
.name = "timer",
85-
};
86-
8780
static void gic_clockevent_cpu_init(unsigned int cpu,
8881
struct clock_event_device *cd)
8982
{
@@ -152,7 +145,8 @@ static int gic_clockevent_init(void)
152145
if (!gic_frequency)
153146
return -ENXIO;
154147

155-
ret = setup_percpu_irq(gic_timer_irq, &gic_compare_irqaction);
148+
ret = request_percpu_irq(gic_timer_irq, gic_compare_interrupt,
149+
"timer", &gic_clockevent_device);
156150
if (ret < 0) {
157151
pr_err("IRQ %d setup failed (%d)\n", gic_timer_irq, ret);
158152
return ret;

drivers/clocksource/sh_tmu.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,6 @@ static void sh_tmu_start_stop_ch(struct sh_tmu_channel *ch, int start)
143143

144144
static int __sh_tmu_enable(struct sh_tmu_channel *ch)
145145
{
146-
int ret;
147-
148-
/* enable clock */
149-
ret = clk_enable(ch->tmu->clk);
150-
if (ret) {
151-
dev_err(&ch->tmu->pdev->dev, "ch%u: cannot enable clock\n",
152-
ch->index);
153-
return ret;
154-
}
155-
156146
/* make sure channel is disabled */
157147
sh_tmu_start_stop_ch(ch, 0);
158148

@@ -174,7 +164,6 @@ static int sh_tmu_enable(struct sh_tmu_channel *ch)
174164
if (ch->enable_count++ > 0)
175165
return 0;
176166

177-
pm_runtime_get_sync(&ch->tmu->pdev->dev);
178167
dev_pm_syscore_device(&ch->tmu->pdev->dev, true);
179168

180169
return __sh_tmu_enable(ch);
@@ -187,9 +176,6 @@ static void __sh_tmu_disable(struct sh_tmu_channel *ch)
187176

188177
/* disable interrupts in TMU block */
189178
sh_tmu_write(ch, TCR, TCR_TPSC_CLK4);
190-
191-
/* stop clock */
192-
clk_disable(ch->tmu->clk);
193179
}
194180

195181
static void sh_tmu_disable(struct sh_tmu_channel *ch)
@@ -203,7 +189,6 @@ static void sh_tmu_disable(struct sh_tmu_channel *ch)
203189
__sh_tmu_disable(ch);
204190

205191
dev_pm_syscore_device(&ch->tmu->pdev->dev, false);
206-
pm_runtime_put(&ch->tmu->pdev->dev);
207192
}
208193

209194
static void sh_tmu_set_next(struct sh_tmu_channel *ch, unsigned long delta,
@@ -552,7 +537,6 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev)
552537
goto err_clk_unprepare;
553538

554539
tmu->rate = clk_get_rate(tmu->clk) / 4;
555-
clk_disable(tmu->clk);
556540

557541
/* Map the memory resource. */
558542
ret = sh_tmu_map_memory(tmu);
@@ -626,8 +610,6 @@ static int sh_tmu_probe(struct platform_device *pdev)
626610
out:
627611
if (tmu->has_clockevent || tmu->has_clocksource)
628612
pm_runtime_irq_safe(&pdev->dev);
629-
else
630-
pm_runtime_idle(&pdev->dev);
631613

632614
return 0;
633615
}

drivers/clocksource/timer-armada-370-xp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* doing otherwise leads to using a clocksource whose frequency varies
2323
* when doing cpufreq frequency changes.
2424
*
25-
* See Documentation/devicetree/bindings/timer/marvell,armada-370-xp-timer.txt
25+
* See Documentation/devicetree/bindings/timer/marvell,armada-370-timer.yaml
2626
*/
2727

2828
#include <linux/init.h>

drivers/clocksource/timer-sp804.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,21 +106,25 @@ static u64 notrace sp804_read(void)
106106
return ~readl_relaxed(sched_clkevt->value);
107107
}
108108

109+
/* Register delay timer backed by the hardware counter */
109110
#ifdef CONFIG_ARM
110111
static struct delay_timer delay;
112+
static struct sp804_clkevt *delay_clkevt;
113+
111114
static unsigned long sp804_read_delay_timer_read(void)
112115
{
113-
return sp804_read();
116+
return ~readl_relaxed(delay_clkevt->value);
114117
}
115118

116-
static void sp804_register_delay_timer(int freq)
119+
static void sp804_register_delay_timer(struct sp804_clkevt *clk, int freq)
117120
{
121+
delay_clkevt = clk;
118122
delay.freq = freq;
119123
delay.read_current_timer = sp804_read_delay_timer_read;
120124
register_current_timer_delay(&delay);
121125
}
122126
#else
123-
static inline void sp804_register_delay_timer(int freq) {}
127+
static inline void sp804_register_delay_timer(struct sp804_clkevt *clk, int freq) {}
124128
#endif
125129

126130
static int __init sp804_clocksource_and_sched_clock_init(void __iomem *base,
@@ -135,8 +139,6 @@ static int __init sp804_clocksource_and_sched_clock_init(void __iomem *base,
135139
if (rate < 0)
136140
return -EINVAL;
137141

138-
sp804_register_delay_timer(rate);
139-
140142
clkevt = sp804_clkevt_get(base);
141143

142144
writel(0, clkevt->ctrl);
@@ -152,6 +154,8 @@ static int __init sp804_clocksource_and_sched_clock_init(void __iomem *base,
152154
clocksource_mmio_init(clkevt->value, name,
153155
rate, 200, 32, clocksource_mmio_readl_down);
154156

157+
sp804_register_delay_timer(clkevt, rate);
158+
155159
if (use_sched_clock) {
156160
sched_clkevt = clkevt;
157161
sched_clock_register(sp804_read, 32, rate);

0 commit comments

Comments
 (0)