Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer fixes from Ingo Molnar:
"Two clocksource driver fixes, and an idle loop RCU warning fix"

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
clocksource/drivers/sun5i: Fix cpufreq interaction with sched_clock()
clocksource/drivers: Fix various !CONFIG_HAS_IOMEM build errors
timers/tick/broadcast-hrtimer: Fix suspicious RCU usage in idle loop

+12 -9
+3
drivers/clocksource/Kconfig
··· 192 192 config SH_TIMER_CMT 193 193 bool "Renesas CMT timer driver" if COMPILE_TEST 194 194 depends on GENERIC_CLOCKEVENTS 195 + depends on HAS_IOMEM 195 196 default SYS_SUPPORTS_SH_CMT 196 197 help 197 198 This enables build of a clocksource and clockevent driver for ··· 202 201 config SH_TIMER_MTU2 203 202 bool "Renesas MTU2 timer driver" if COMPILE_TEST 204 203 depends on GENERIC_CLOCKEVENTS 204 + depends on HAS_IOMEM 205 205 default SYS_SUPPORTS_SH_MTU2 206 206 help 207 207 This enables build of a clockevent driver for the Multi-Function ··· 212 210 config SH_TIMER_TMU 213 211 bool "Renesas TMU timer driver" if COMPILE_TEST 214 212 depends on GENERIC_CLOCKEVENTS 213 + depends on HAS_IOMEM 215 214 default SYS_SUPPORTS_SH_TMU 216 215 help 217 216 This enables build of a clocksource and clockevent driver for
-7
drivers/clocksource/timer-sun5i.c
··· 17 17 #include <linux/irq.h> 18 18 #include <linux/irqreturn.h> 19 19 #include <linux/reset.h> 20 - #include <linux/sched_clock.h> 21 20 #include <linux/of.h> 22 21 #include <linux/of_address.h> 23 22 #include <linux/of_irq.h> ··· 136 137 .dev_id = &sun5i_clockevent, 137 138 }; 138 139 139 - static u64 sun5i_timer_sched_read(void) 140 - { 141 - return ~readl(timer_base + TIMER_CNTVAL_LO_REG(1)); 142 - } 143 - 144 140 static void __init sun5i_timer_init(struct device_node *node) 145 141 { 146 142 struct reset_control *rstc; ··· 166 172 writel(TIMER_CTL_ENABLE | TIMER_CTL_RELOAD, 167 173 timer_base + TIMER_CTL_REG(1)); 168 174 169 - sched_clock_register(sun5i_timer_sched_read, 32, rate); 170 175 clocksource_mmio_init(timer_base + TIMER_CNTVAL_LO_REG(1), node->name, 171 176 rate, 340, 32, clocksource_mmio_readl_down); 172 177
+9 -2
kernel/time/tick-broadcast-hrtimer.c
··· 49 49 */ 50 50 static int bc_set_next(ktime_t expires, struct clock_event_device *bc) 51 51 { 52 + int bc_moved; 52 53 /* 53 54 * We try to cancel the timer first. If the callback is on 54 55 * flight on some other cpu then we let it handle it. If we ··· 61 60 * restart the timer because we are in the callback, but we 62 61 * can set the expiry time and let the callback return 63 62 * HRTIMER_RESTART. 63 + * 64 + * Since we are in the idle loop at this point and because 65 + * hrtimer_{start/cancel} functions call into tracing, 66 + * calls to these functions must be bound within RCU_NONIDLE. 64 67 */ 65 - if (hrtimer_try_to_cancel(&bctimer) >= 0) { 66 - hrtimer_start(&bctimer, expires, HRTIMER_MODE_ABS_PINNED); 68 + RCU_NONIDLE(bc_moved = (hrtimer_try_to_cancel(&bctimer) >= 0) ? 69 + !hrtimer_start(&bctimer, expires, HRTIMER_MODE_ABS_PINNED) : 70 + 0); 71 + if (bc_moved) { 67 72 /* Bind the "device" to the cpu */ 68 73 bc->bound_on = smp_processor_id(); 69 74 } else if (bc->bound_on == smp_processor_id()) {