]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
timers drop try lock
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Mon, 13 Jul 2015 12:35:50 +0000 (14:35 +0200)
committerMichal Sojka <sojka@merica.cz>
Sun, 13 Sep 2015 07:47:47 +0000 (09:47 +0200)
Don't try-lock in hardirq context on a rtmutex based lock. We will account
the wrong process as owner.

Cc: stable-rt@vger.kernel.or
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
kernel/time/timer.c

index 292eea0cc4123682b750d1fb9ddc4f73193c8702..4b15aa0de8620a8ad565b5d51f3bd480e06cb3f2 100644 (file)
@@ -1409,13 +1409,11 @@ unsigned long get_next_timer_interrupt(unsigned long now)
 
 #ifdef CONFIG_PREEMPT_RT_FULL
        /*
-        * On PREEMPT_RT we cannot sleep here. If the trylock does not
-        * succeed then we return the worst-case 'expires in 1 tick'
-        * value.  We use the rt functions here directly to avoid a
-        * migrate_disable() call.
+        * On PREEMPT_RT we cannot sleep here. As a result we can't take
+        * the base lock to check when the next timer is pending and so
+        * we assume the next jiffy.
         */
-       if (!spin_do_trylock(&base->lock))
-               return  now + 1;
+       return now + 1;
 #else
        spin_lock(&base->lock);
 #endif
@@ -1424,11 +1422,7 @@ unsigned long get_next_timer_interrupt(unsigned long now)
                        base->next_timer = __next_timer_interrupt(base);
                expires = base->next_timer;
        }
-#ifdef CONFIG_PREEMPT_RT_FULL
-       rt_spin_unlock_after_trylock_in_irq(&base->lock);
-#else
        spin_unlock(&base->lock);
-#endif
 
        if (time_before_eq(expires, now))
                return now;