mac80211: correct legacy rates check in ieee80211_calc_rx_airtime
[platform/kernel/linux-rpi.git] / lib / locking-selftest.c
index 161108e..1266ea3 100644 (file)
 #include <linux/rtmutex.h>
 #include <linux/local_lock.h>
 
+#ifdef CONFIG_PREEMPT_RT
+# define NON_RT(...)
+#else
+# define NON_RT(...)   __VA_ARGS__
+#endif
+
 /*
  * Change this to 1 if you want to see the failure printouts:
  */
@@ -139,7 +145,7 @@ static DEFINE_RT_MUTEX(rtmutex_Z2);
 
 #endif
 
-static local_lock_t local_A = INIT_LOCAL_LOCK(local_A);
+static DEFINE_PER_CPU(local_lock_t, local_A);
 
 /*
  * non-inlined runtime initializers, to let separate locks share
@@ -712,12 +718,18 @@ GENERATE_TESTCASE(ABCDBCDA_rtmutex);
 
 #undef E
 
+#ifdef CONFIG_PREEMPT_RT
+# define RT_PREPARE_DBL_UNLOCK()       { migrate_disable(); rcu_read_lock(); }
+#else
+# define RT_PREPARE_DBL_UNLOCK()
+#endif
 /*
  * Double unlock:
  */
 #define E()                                    \
                                                \
        LOCK(A);                                \
+       RT_PREPARE_DBL_UNLOCK();                \
        UNLOCK(A);                              \
        UNLOCK(A); /* fail */
 
@@ -802,6 +814,7 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_hard_rlock)
 #include "locking-selftest-wlock-hardirq.h"
 GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_hard_wlock)
 
+#ifndef CONFIG_PREEMPT_RT
 #include "locking-selftest-spin-softirq.h"
 GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_soft_spin)
 
@@ -810,10 +823,12 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_soft_rlock)
 
 #include "locking-selftest-wlock-softirq.h"
 GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_soft_wlock)
+#endif
 
 #undef E1
 #undef E2
 
+#ifndef CONFIG_PREEMPT_RT
 /*
  * Enabling hardirqs with a softirq-safe lock held:
  */
@@ -846,6 +861,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2A_rlock)
 #undef E1
 #undef E2
 
+#endif
+
 /*
  * Enabling irqs with an irq-safe lock held:
  */
@@ -875,6 +892,7 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_hard_rlock)
 #include "locking-selftest-wlock-hardirq.h"
 GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_hard_wlock)
 
+#ifndef CONFIG_PREEMPT_RT
 #include "locking-selftest-spin-softirq.h"
 GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_spin)
 
@@ -883,6 +901,7 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_rlock)
 
 #include "locking-selftest-wlock-softirq.h"
 GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_wlock)
+#endif
 
 #undef E1
 #undef E2
@@ -921,6 +940,7 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_hard_rlock)
 #include "locking-selftest-wlock-hardirq.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_hard_wlock)
 
+#ifndef CONFIG_PREEMPT_RT
 #include "locking-selftest-spin-softirq.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_spin)
 
@@ -929,6 +949,7 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_rlock)
 
 #include "locking-selftest-wlock-softirq.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_wlock)
+#endif
 
 #undef E1
 #undef E2
@@ -969,6 +990,7 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_hard_rlock)
 #include "locking-selftest-wlock-hardirq.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_hard_wlock)
 
+#ifndef CONFIG_PREEMPT_RT
 #include "locking-selftest-spin-softirq.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_soft_spin)
 
@@ -977,6 +999,7 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_soft_rlock)
 
 #include "locking-selftest-wlock-softirq.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_soft_wlock)
+#endif
 
 #undef E1
 #undef E2
@@ -1031,6 +1054,7 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_inversion_hard_rlock)
 #include "locking-selftest-wlock-hardirq.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irq_inversion_hard_wlock)
 
+#ifndef CONFIG_PREEMPT_RT
 #include "locking-selftest-spin-softirq.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irq_inversion_soft_spin)
 
@@ -1039,6 +1063,7 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_inversion_soft_rlock)
 
 #include "locking-selftest-wlock-softirq.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irq_inversion_soft_wlock)
+#endif
 
 #undef E1
 #undef E2
@@ -1206,12 +1231,14 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion_hard_rlock)
 #include "locking-selftest-wlock.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion_hard_wlock)
 
+#ifndef CONFIG_PREEMPT_RT
 #include "locking-selftest-softirq.h"
 #include "locking-selftest-rlock.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion_soft_rlock)
 
 #include "locking-selftest-wlock.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion_soft_wlock)
+#endif
 
 #undef E1
 #undef E2
@@ -1252,12 +1279,14 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion2_hard_rlock)
 #include "locking-selftest-wlock.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion2_hard_wlock)
 
+#ifndef CONFIG_PREEMPT_RT
 #include "locking-selftest-softirq.h"
 #include "locking-selftest-rlock.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion2_soft_rlock)
 
 #include "locking-selftest-wlock.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion2_soft_wlock)
+#endif
 
 #undef E1
 #undef E2
@@ -1306,12 +1335,14 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion3_hard_rlock)
 #include "locking-selftest-wlock.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion3_hard_wlock)
 
+#ifndef CONFIG_PREEMPT_RT
 #include "locking-selftest-softirq.h"
 #include "locking-selftest-rlock.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion3_soft_rlock)
 
 #include "locking-selftest-wlock.h"
 GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion3_soft_wlock)
+#endif
 
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 # define I_SPINLOCK(x) lockdep_reset_lock(&lock_##x.dep_map)
@@ -1320,7 +1351,7 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion3_soft_wlock)
 # define I_MUTEX(x)    lockdep_reset_lock(&mutex_##x.dep_map)
 # define I_RWSEM(x)    lockdep_reset_lock(&rwsem_##x.dep_map)
 # define I_WW(x)       lockdep_reset_lock(&x.dep_map)
-# define I_LOCAL_LOCK(x) lockdep_reset_lock(&local_##x.dep_map)
+# define I_LOCAL_LOCK(x) lockdep_reset_lock(this_cpu_ptr(&local_##x.dep_map))
 #ifdef CONFIG_RT_MUTEXES
 # define I_RTMUTEX(x)  lockdep_reset_lock(&rtmutex_##x.dep_map)
 #endif
@@ -1380,7 +1411,7 @@ static void reset_locks(void)
        init_shared_classes();
        raw_spin_lock_init(&raw_lock_A);
        raw_spin_lock_init(&raw_lock_B);
-       local_lock_init(&local_A);
+       local_lock_init(this_cpu_ptr(&local_A));
 
        ww_mutex_init(&o, &ww_lockdep); ww_mutex_init(&o2, &ww_lockdep); ww_mutex_init(&o3, &ww_lockdep);
        memset(&t, 0, sizeof(t)); memset(&t2, 0, sizeof(t2));
@@ -1398,7 +1429,13 @@ static int unexpected_testcase_failures;
 
 static void dotest(void (*testcase_fn)(void), int expected, int lockclass_mask)
 {
-       unsigned long saved_preempt_count = preempt_count();
+       int saved_preempt_count = preempt_count();
+#ifdef CONFIG_PREEMPT_RT
+#ifdef CONFIG_SMP
+       int saved_mgd_count = current->migration_disabled;
+#endif
+       int saved_rcu_count = current->rcu_read_lock_nesting;
+#endif
 
        WARN_ON(irqs_disabled());
 
@@ -1432,6 +1469,18 @@ static void dotest(void (*testcase_fn)(void), int expected, int lockclass_mask)
         * count, so restore it:
         */
        preempt_count_set(saved_preempt_count);
+
+#ifdef CONFIG_PREEMPT_RT
+#ifdef CONFIG_SMP
+       while (current->migration_disabled > saved_mgd_count)
+               migrate_enable();
+#endif
+
+       while (current->rcu_read_lock_nesting > saved_rcu_count)
+               rcu_read_unlock();
+       WARN_ON_ONCE(current->rcu_read_lock_nesting < saved_rcu_count);
+#endif
+
 #ifdef CONFIG_TRACE_IRQFLAGS
        if (softirq_count())
                current->softirqs_enabled = 0;
@@ -1499,7 +1548,7 @@ static inline void print_testname(const char *testname)
 
 #define DO_TESTCASE_2x2RW(desc, name, nr)                      \
        DO_TESTCASE_2RW("hard-"desc, name##_hard, nr)           \
-       DO_TESTCASE_2RW("soft-"desc, name##_soft, nr)           \
+       NON_RT(DO_TESTCASE_2RW("soft-"desc, name##_soft, nr))   \
 
 #define DO_TESTCASE_6x2x2RW(desc, name)                                \
        DO_TESTCASE_2x2RW(desc, name, 123);                     \
@@ -1547,19 +1596,19 @@ static inline void print_testname(const char *testname)
 
 #define DO_TESTCASE_2I(desc, name, nr)                         \
        DO_TESTCASE_1("hard-"desc, name##_hard, nr);            \
-       DO_TESTCASE_1("soft-"desc, name##_soft, nr);
+       NON_RT(DO_TESTCASE_1("soft-"desc, name##_soft, nr));
 
 #define DO_TESTCASE_2IB(desc, name, nr)                                \
        DO_TESTCASE_1B("hard-"desc, name##_hard, nr);           \
-       DO_TESTCASE_1B("soft-"desc, name##_soft, nr);
+       NON_RT(DO_TESTCASE_1B("soft-"desc, name##_soft, nr));
 
 #define DO_TESTCASE_6I(desc, name, nr)                         \
        DO_TESTCASE_3("hard-"desc, name##_hard, nr);            \
-       DO_TESTCASE_3("soft-"desc, name##_soft, nr);
+       NON_RT(DO_TESTCASE_3("soft-"desc, name##_soft, nr));
 
 #define DO_TESTCASE_6IRW(desc, name, nr)                       \
        DO_TESTCASE_3RW("hard-"desc, name##_hard, nr);          \
-       DO_TESTCASE_3RW("soft-"desc, name##_soft, nr);
+       NON_RT(DO_TESTCASE_3RW("soft-"desc, name##_soft, nr));
 
 #define DO_TESTCASE_2x3(desc, name)                            \
        DO_TESTCASE_3(desc, name, 12);                          \
@@ -1651,6 +1700,20 @@ static void ww_test_fail_acquire(void)
 #endif
 }
 
+#ifdef CONFIG_PREEMPT_RT
+#define ww_mutex_base_lock(b)                  rt_mutex_lock(b)
+#define ww_mutex_base_lock_nest_lock(b, b2)    rt_mutex_lock_nest_lock(b, b2)
+#define ww_mutex_base_lock_interruptible(b)    rt_mutex_lock_interruptible(b)
+#define ww_mutex_base_lock_killable(b)         rt_mutex_lock_killable(b)
+#define ww_mutex_base_unlock(b)                        rt_mutex_unlock(b)
+#else
+#define ww_mutex_base_lock(b)                  mutex_lock(b)
+#define ww_mutex_base_lock_nest_lock(b, b2)    mutex_lock_nest_lock(b, b2)
+#define ww_mutex_base_lock_interruptible(b)    mutex_lock_interruptible(b)
+#define ww_mutex_base_lock_killable(b)         mutex_lock_killable(b)
+#define ww_mutex_base_unlock(b)                        mutex_unlock(b)
+#endif
+
 static void ww_test_normal(void)
 {
        int ret;
@@ -1665,50 +1728,50 @@ static void ww_test_normal(void)
 
        /* mutex_lock (and indirectly, mutex_lock_nested) */
        o.ctx = (void *)~0UL;
-       mutex_lock(&o.base);
-       mutex_unlock(&o.base);
+       ww_mutex_base_lock(&o.base);
+       ww_mutex_base_unlock(&o.base);
        WARN_ON(o.ctx != (void *)~0UL);
 
        /* mutex_lock_interruptible (and *_nested) */
        o.ctx = (void *)~0UL;
-       ret = mutex_lock_interruptible(&o.base);
+       ret = ww_mutex_base_lock_interruptible(&o.base);
        if (!ret)
-               mutex_unlock(&o.base);
+               ww_mutex_base_unlock(&o.base);
        else
                WARN_ON(1);
        WARN_ON(o.ctx != (void *)~0UL);
 
        /* mutex_lock_killable (and *_nested) */
        o.ctx = (void *)~0UL;
-       ret = mutex_lock_killable(&o.base);
+       ret = ww_mutex_base_lock_killable(&o.base);
        if (!ret)
-               mutex_unlock(&o.base);
+               ww_mutex_base_unlock(&o.base);
        else
                WARN_ON(1);
        WARN_ON(o.ctx != (void *)~0UL);
 
        /* trylock, succeeding */
        o.ctx = (void *)~0UL;
-       ret = mutex_trylock(&o.base);
+       ret = ww_mutex_base_trylock(&o.base);
        WARN_ON(!ret);
        if (ret)
-               mutex_unlock(&o.base);
+               ww_mutex_base_unlock(&o.base);
        else
                WARN_ON(1);
        WARN_ON(o.ctx != (void *)~0UL);
 
        /* trylock, failing */
        o.ctx = (void *)~0UL;
-       mutex_lock(&o.base);
-       ret = mutex_trylock(&o.base);
+       ww_mutex_base_lock(&o.base);
+       ret = ww_mutex_base_trylock(&o.base);
        WARN_ON(ret);
-       mutex_unlock(&o.base);
+       ww_mutex_base_unlock(&o.base);
        WARN_ON(o.ctx != (void *)~0UL);
 
        /* nest_lock */
        o.ctx = (void *)~0UL;
-       mutex_lock_nest_lock(&o.base, &t);
-       mutex_unlock(&o.base);
+       ww_mutex_base_lock_nest_lock(&o.base, &t);
+       ww_mutex_base_unlock(&o.base);
        WARN_ON(o.ctx != (void *)~0UL);
 }
 
@@ -1721,7 +1784,7 @@ static void ww_test_two_contexts(void)
 static void ww_test_diff_class(void)
 {
        WWAI(&t);
-#ifdef CONFIG_DEBUG_MUTEXES
+#ifdef DEBUG_WW_MUTEXES
        t.ww_class = NULL;
 #endif
        WWL(&o, &t);
@@ -1785,7 +1848,7 @@ static void ww_test_edeadlk_normal(void)
 {
        int ret;
 
-       mutex_lock(&o2.base);
+       ww_mutex_base_lock(&o2.base);
        o2.ctx = &t2;
        mutex_release(&o2.base.dep_map, _THIS_IP_);
 
@@ -1801,7 +1864,7 @@ static void ww_test_edeadlk_normal(void)
 
        o2.ctx = NULL;
        mutex_acquire(&o2.base.dep_map, 0, 1, _THIS_IP_);
-       mutex_unlock(&o2.base);
+       ww_mutex_base_unlock(&o2.base);
        WWU(&o);
 
        WWL(&o2, &t);
@@ -1811,7 +1874,7 @@ static void ww_test_edeadlk_normal_slow(void)
 {
        int ret;
 
-       mutex_lock(&o2.base);
+       ww_mutex_base_lock(&o2.base);
        mutex_release(&o2.base.dep_map, _THIS_IP_);
        o2.ctx = &t2;
 
@@ -1827,7 +1890,7 @@ static void ww_test_edeadlk_normal_slow(void)
 
        o2.ctx = NULL;
        mutex_acquire(&o2.base.dep_map, 0, 1, _THIS_IP_);
-       mutex_unlock(&o2.base);
+       ww_mutex_base_unlock(&o2.base);
        WWU(&o);
 
        ww_mutex_lock_slow(&o2, &t);
@@ -1837,7 +1900,7 @@ static void ww_test_edeadlk_no_unlock(void)
 {
        int ret;
 
-       mutex_lock(&o2.base);
+       ww_mutex_base_lock(&o2.base);
        o2.ctx = &t2;
        mutex_release(&o2.base.dep_map, _THIS_IP_);
 
@@ -1853,7 +1916,7 @@ static void ww_test_edeadlk_no_unlock(void)
 
        o2.ctx = NULL;
        mutex_acquire(&o2.base.dep_map, 0, 1, _THIS_IP_);
-       mutex_unlock(&o2.base);
+       ww_mutex_base_unlock(&o2.base);
 
        WWL(&o2, &t);
 }
@@ -1862,7 +1925,7 @@ static void ww_test_edeadlk_no_unlock_slow(void)
 {
        int ret;
 
-       mutex_lock(&o2.base);
+       ww_mutex_base_lock(&o2.base);
        mutex_release(&o2.base.dep_map, _THIS_IP_);
        o2.ctx = &t2;
 
@@ -1878,7 +1941,7 @@ static void ww_test_edeadlk_no_unlock_slow(void)
 
        o2.ctx = NULL;
        mutex_acquire(&o2.base.dep_map, 0, 1, _THIS_IP_);
-       mutex_unlock(&o2.base);
+       ww_mutex_base_unlock(&o2.base);
 
        ww_mutex_lock_slow(&o2, &t);
 }
@@ -1887,7 +1950,7 @@ static void ww_test_edeadlk_acquire_more(void)
 {
        int ret;
 
-       mutex_lock(&o2.base);
+       ww_mutex_base_lock(&o2.base);
        mutex_release(&o2.base.dep_map, _THIS_IP_);
        o2.ctx = &t2;
 
@@ -1908,7 +1971,7 @@ static void ww_test_edeadlk_acquire_more_slow(void)
 {
        int ret;
 
-       mutex_lock(&o2.base);
+       ww_mutex_base_lock(&o2.base);
        mutex_release(&o2.base.dep_map, _THIS_IP_);
        o2.ctx = &t2;
 
@@ -1929,11 +1992,11 @@ static void ww_test_edeadlk_acquire_more_edeadlk(void)
 {
        int ret;
 
-       mutex_lock(&o2.base);
+       ww_mutex_base_lock(&o2.base);
        mutex_release(&o2.base.dep_map, _THIS_IP_);
        o2.ctx = &t2;
 
-       mutex_lock(&o3.base);
+       ww_mutex_base_lock(&o3.base);
        mutex_release(&o3.base.dep_map, _THIS_IP_);
        o3.ctx = &t2;
 
@@ -1955,11 +2018,11 @@ static void ww_test_edeadlk_acquire_more_edeadlk_slow(void)
 {
        int ret;
 
-       mutex_lock(&o2.base);
+       ww_mutex_base_lock(&o2.base);
        mutex_release(&o2.base.dep_map, _THIS_IP_);
        o2.ctx = &t2;
 
-       mutex_lock(&o3.base);
+       ww_mutex_base_lock(&o3.base);
        mutex_release(&o3.base.dep_map, _THIS_IP_);
        o3.ctx = &t2;
 
@@ -1980,7 +2043,7 @@ static void ww_test_edeadlk_acquire_wrong(void)
 {
        int ret;
 
-       mutex_lock(&o2.base);
+       ww_mutex_base_lock(&o2.base);
        mutex_release(&o2.base.dep_map, _THIS_IP_);
        o2.ctx = &t2;
 
@@ -2005,7 +2068,7 @@ static void ww_test_edeadlk_acquire_wrong_slow(void)
 {
        int ret;
 
-       mutex_lock(&o2.base);
+       ww_mutex_base_lock(&o2.base);
        mutex_release(&o2.base.dep_map, _THIS_IP_);
        o2.ctx = &t2;
 
@@ -2646,8 +2709,8 @@ static void wait_context_tests(void)
 
 static void local_lock_2(void)
 {
-       local_lock_acquire(&local_A);   /* IRQ-ON */
-       local_lock_release(&local_A);
+       local_lock(&local_A);   /* IRQ-ON */
+       local_unlock(&local_A);
 
        HARDIRQ_ENTER();
        spin_lock(&lock_A);             /* IN-IRQ */
@@ -2656,18 +2719,18 @@ static void local_lock_2(void)
 
        HARDIRQ_DISABLE();
        spin_lock(&lock_A);
-       local_lock_acquire(&local_A);   /* IN-IRQ <-> IRQ-ON cycle, false */
-       local_lock_release(&local_A);
+       local_lock(&local_A);   /* IN-IRQ <-> IRQ-ON cycle, false */
+       local_unlock(&local_A);
        spin_unlock(&lock_A);
        HARDIRQ_ENABLE();
 }
 
 static void local_lock_3A(void)
 {
-       local_lock_acquire(&local_A);   /* IRQ-ON */
+       local_lock(&local_A);   /* IRQ-ON */
        spin_lock(&lock_B);             /* IRQ-ON */
        spin_unlock(&lock_B);
-       local_lock_release(&local_A);
+       local_unlock(&local_A);
 
        HARDIRQ_ENTER();
        spin_lock(&lock_A);             /* IN-IRQ */
@@ -2676,18 +2739,18 @@ static void local_lock_3A(void)
 
        HARDIRQ_DISABLE();
        spin_lock(&lock_A);
-       local_lock_acquire(&local_A);   /* IN-IRQ <-> IRQ-ON cycle only if we count local_lock(), false */
-       local_lock_release(&local_A);
+       local_lock(&local_A);   /* IN-IRQ <-> IRQ-ON cycle only if we count local_lock(), false */
+       local_unlock(&local_A);
        spin_unlock(&lock_A);
        HARDIRQ_ENABLE();
 }
 
 static void local_lock_3B(void)
 {
-       local_lock_acquire(&local_A);   /* IRQ-ON */
+       local_lock(&local_A);   /* IRQ-ON */
        spin_lock(&lock_B);             /* IRQ-ON */
        spin_unlock(&lock_B);
-       local_lock_release(&local_A);
+       local_unlock(&local_A);
 
        HARDIRQ_ENTER();
        spin_lock(&lock_A);             /* IN-IRQ */
@@ -2696,8 +2759,8 @@ static void local_lock_3B(void)
 
        HARDIRQ_DISABLE();
        spin_lock(&lock_A);
-       local_lock_acquire(&local_A);   /* IN-IRQ <-> IRQ-ON cycle only if we count local_lock(), false */
-       local_lock_release(&local_A);
+       local_lock(&local_A);   /* IN-IRQ <-> IRQ-ON cycle only if we count local_lock(), false */
+       local_unlock(&local_A);
        spin_unlock(&lock_A);
        HARDIRQ_ENABLE();
 
@@ -2812,7 +2875,7 @@ void locking_selftest(void)
        printk("------------------------\n");
        printk("| Locking API testsuite:\n");
        printk("----------------------------------------------------------------------------\n");
-       printk("                                 | spin |wlock |rlock |mutex | wsem | rsem |\n");
+       printk("                                 | spin |wlock |rlock |mutex | wsem | rsem |rtmutex\n");
        printk("  --------------------------------------------------------------------------\n");
 
        init_shared_classes();
@@ -2885,12 +2948,11 @@ void locking_selftest(void)
        DO_TESTCASE_6x1RR("rlock W1R2/R2R3/W3W1", W1R2_R2R3_W3W1);
 
        printk("  --------------------------------------------------------------------------\n");
-
        /*
         * irq-context testcases:
         */
        DO_TESTCASE_2x6("irqs-on + irq-safe-A", irqsafe1);
-       DO_TESTCASE_2x3("sirq-safe-A => hirqs-on", irqsafe2A);
+       NON_RT(DO_TESTCASE_2x3("sirq-safe-A => hirqs-on", irqsafe2A));
        DO_TESTCASE_2x6("safe-A + irqs-on", irqsafe2B);
        DO_TESTCASE_6x6("safe-A + unsafe-B #1", irqsafe3);
        DO_TESTCASE_6x6("safe-A + unsafe-B #2", irqsafe4);