From 58a5d5af47d5e6515268faf3b8f3e01aa9ccad81 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sat, 27 Feb 2016 10:47:10 +0100 Subject: [PATCH 125/365] tick/broadcast: Make broadcast hrtimer irqsafe Otherwise we end up with the following: |================================= |[ INFO: inconsistent lock state ] |4.4.2-rt7+ #5 Not tainted |--------------------------------- |inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage. |ktimersoftd/0/4 [HC0[0]:SC0[0]:HE1:SE1] takes: | (tick_broadcast_lock){?.....}, at: [] tick_handle_oneshot_broadcast+0x58/0x27c |{IN-HARDIRQ-W} state was registered at: | [] mark_lock+0x19c/0x6a0 | [] __lock_acquire+0xb1c/0x2100 | [] lock_acquire+0xf8/0x230 | [] _raw_spin_lock_irqsave+0x50/0x68 | [] tick_broadcast_switch_to_oneshot+0x20/0x60 | [] tick_switch_to_oneshot+0x64/0xd8 | [] tick_init_highres+0x1c/0x24 | [] hrtimer_run_queues+0x78/0x100 | [] update_process_times+0x38/0x74 | [] tick_periodic+0x60/0x140 | [] tick_handle_periodic+0x2c/0x94 | [] arch_timer_handler_phys+0x3c/0x48 | [] handle_percpu_devid_irq+0x100/0x390 | [] generic_handle_irq+0x34/0x4c | [] __handle_domain_irq+0x90/0xf8 | [] gic_handle_irq+0x5c/0xa4 | [] el1_irq+0x6c/0xec | [] default_idle_call+0x2c/0x44 | [] cpu_startup_entry+0x3cc/0x410 | [] rest_init+0x158/0x168 | [] start_kernel+0x3a0/0x3b4 | [<0000000080621000>] 0x80621000 |irq event stamp: 18723 |hardirqs last enabled at (18723): [] _raw_spin_unlock_irq+0x38/0x80 |hardirqs last disabled at (18722): [] run_hrtimer_softirq+0x2c/0x2f4 |softirqs last enabled at (0): [] copy_process.isra.50+0x300/0x16d4 |softirqs last disabled at (0): [< (null)>] (null) Reported-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner --- kernel/time/tick-broadcast-hrtimer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/time/tick-broadcast-hrtimer.c b/kernel/time/tick-broadcast-hrtimer.c index 690b797f522e..fe8ba1619879 100644 --- a/kernel/time/tick-broadcast-hrtimer.c +++ b/kernel/time/tick-broadcast-hrtimer.c @@ -107,5 +107,6 @@ void tick_setup_hrtimer_broadcast(void) { hrtimer_init(&bctimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); bctimer.function = bc_handler; + bctimer.irqsafe = true; clockevents_register_device(&ce_broadcast_hrtimer); } -- 2.28.0