2020-04-21 20:13:52 +00:00
|
|
|
From 17d81d48ff86eb0c073d5d52660b57dd2b6a3c4c Mon Sep 17 00:00:00 2001
|
2018-08-27 14:32:32 +00:00
|
|
|
From: Josh Cartwright <josh.cartwright@ni.com>
|
|
|
|
Date: Wed, 28 Jan 2015 13:08:45 -0600
|
2020-04-21 20:13:52 +00:00
|
|
|
Subject: [PATCH 237/325] lockdep: selftest: fix warnings due to missing
|
2019-04-08 23:49:20 +00:00
|
|
|
PREEMPT_RT conditionals
|
2020-04-21 20:13:52 +00:00
|
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.115-rt48.tar.xz
|
2018-08-27 14:32:32 +00:00
|
|
|
|
|
|
|
"lockdep: Selftest: Only do hardirq context test for raw spinlock"
|
|
|
|
disabled the execution of certain tests with PREEMPT_RT_FULL, but did
|
|
|
|
not prevent the tests from still being defined. This leads to warnings
|
|
|
|
like:
|
|
|
|
|
|
|
|
./linux/lib/locking-selftest.c:574:1: warning: 'irqsafe1_hard_rlock_12' defined but not used [-Wunused-function]
|
|
|
|
./linux/lib/locking-selftest.c:574:1: warning: 'irqsafe1_hard_rlock_21' defined but not used [-Wunused-function]
|
|
|
|
./linux/lib/locking-selftest.c:577:1: warning: 'irqsafe1_hard_wlock_12' defined but not used [-Wunused-function]
|
|
|
|
./linux/lib/locking-selftest.c:577:1: warning: 'irqsafe1_hard_wlock_21' defined but not used [-Wunused-function]
|
|
|
|
./linux/lib/locking-selftest.c:580:1: warning: 'irqsafe1_soft_spin_12' defined but not used [-Wunused-function]
|
|
|
|
...
|
|
|
|
|
|
|
|
Fixed by wrapping the test definitions in #ifndef CONFIG_PREEMPT_RT_FULL
|
|
|
|
conditionals.
|
|
|
|
|
|
|
|
|
|
|
|
Signed-off-by: Josh Cartwright <josh.cartwright@ni.com>
|
|
|
|
Signed-off-by: Xander Huff <xander.huff@ni.com>
|
|
|
|
Acked-by: Gratian Crisan <gratian.crisan@ni.com>
|
|
|
|
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
|
|
---
|
2019-04-08 23:49:20 +00:00
|
|
|
lib/locking-selftest.c | 27 +++++++++++++++++++++++++++
|
2018-08-27 14:32:32 +00:00
|
|
|
1 file changed, 27 insertions(+)
|
|
|
|
|
2019-04-08 23:49:20 +00:00
|
|
|
diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c
|
|
|
|
index 5cdf3809905e..32db9532ddd4 100644
|
2018-08-27 14:32:32 +00:00
|
|
|
--- a/lib/locking-selftest.c
|
|
|
|
+++ b/lib/locking-selftest.c
|
|
|
|
@@ -742,6 +742,8 @@ GENERATE_TESTCASE(init_held_rtmutex);
|
|
|
|
#include "locking-selftest-spin-hardirq.h"
|
|
|
|
GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_hard_spin)
|
|
|
|
|
|
|
|
+#ifndef CONFIG_PREEMPT_RT_FULL
|
|
|
|
+
|
|
|
|
#include "locking-selftest-rlock-hardirq.h"
|
|
|
|
GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_hard_rlock)
|
|
|
|
|
2019-04-08 23:49:20 +00:00
|
|
|
@@ -757,9 +759,12 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_soft_rlock)
|
2018-08-27 14:32:32 +00:00
|
|
|
#include "locking-selftest-wlock-softirq.h"
|
|
|
|
GENERATE_PERMUTATIONS_2_EVENTS(irqsafe1_soft_wlock)
|
|
|
|
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#undef E1
|
|
|
|
#undef E2
|
|
|
|
|
|
|
|
+#ifndef CONFIG_PREEMPT_RT_FULL
|
|
|
|
/*
|
|
|
|
* Enabling hardirqs with a softirq-safe lock held:
|
|
|
|
*/
|
2019-04-08 23:49:20 +00:00
|
|
|
@@ -792,6 +797,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2A_rlock)
|
2018-08-27 14:32:32 +00:00
|
|
|
#undef E1
|
|
|
|
#undef E2
|
|
|
|
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
/*
|
|
|
|
* Enabling irqs with an irq-safe lock held:
|
|
|
|
*/
|
2019-04-08 23:49:20 +00:00
|
|
|
@@ -815,6 +822,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2A_rlock)
|
2018-08-27 14:32:32 +00:00
|
|
|
#include "locking-selftest-spin-hardirq.h"
|
|
|
|
GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_hard_spin)
|
|
|
|
|
|
|
|
+#ifndef CONFIG_PREEMPT_RT_FULL
|
|
|
|
+
|
|
|
|
#include "locking-selftest-rlock-hardirq.h"
|
|
|
|
GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_hard_rlock)
|
|
|
|
|
2019-04-08 23:49:20 +00:00
|
|
|
@@ -830,6 +839,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_rlock)
|
2018-08-27 14:32:32 +00:00
|
|
|
#include "locking-selftest-wlock-softirq.h"
|
|
|
|
GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_wlock)
|
|
|
|
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#undef E1
|
|
|
|
#undef E2
|
|
|
|
|
2019-04-08 23:49:20 +00:00
|
|
|
@@ -861,6 +872,8 @@ GENERATE_PERMUTATIONS_2_EVENTS(irqsafe2B_soft_wlock)
|
2018-08-27 14:32:32 +00:00
|
|
|
#include "locking-selftest-spin-hardirq.h"
|
|
|
|
GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_hard_spin)
|
|
|
|
|
|
|
|
+#ifndef CONFIG_PREEMPT_RT_FULL
|
|
|
|
+
|
|
|
|
#include "locking-selftest-rlock-hardirq.h"
|
|
|
|
GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_hard_rlock)
|
|
|
|
|
2019-04-08 23:49:20 +00:00
|
|
|
@@ -876,6 +889,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_rlock)
|
2018-08-27 14:32:32 +00:00
|
|
|
#include "locking-selftest-wlock-softirq.h"
|
|
|
|
GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_wlock)
|
|
|
|
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#undef E1
|
|
|
|
#undef E2
|
|
|
|
#undef E3
|
2019-04-08 23:49:20 +00:00
|
|
|
@@ -909,6 +924,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe3_soft_wlock)
|
2018-08-27 14:32:32 +00:00
|
|
|
#include "locking-selftest-spin-hardirq.h"
|
|
|
|
GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_hard_spin)
|
|
|
|
|
|
|
|
+#ifndef CONFIG_PREEMPT_RT_FULL
|
|
|
|
+
|
|
|
|
#include "locking-selftest-rlock-hardirq.h"
|
|
|
|
GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_hard_rlock)
|
|
|
|
|
2019-04-08 23:49:20 +00:00
|
|
|
@@ -924,10 +941,14 @@ GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_soft_rlock)
|
2018-08-27 14:32:32 +00:00
|
|
|
#include "locking-selftest-wlock-softirq.h"
|
|
|
|
GENERATE_PERMUTATIONS_3_EVENTS(irqsafe4_soft_wlock)
|
|
|
|
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#undef E1
|
|
|
|
#undef E2
|
|
|
|
#undef E3
|
|
|
|
|
|
|
|
+#ifndef CONFIG_PREEMPT_RT_FULL
|
|
|
|
+
|
|
|
|
/*
|
|
|
|
* read-lock / write-lock irq inversion.
|
|
|
|
*
|
2019-04-08 23:49:20 +00:00
|
|
|
@@ -990,6 +1011,10 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_inversion_soft_wlock)
|
2018-08-27 14:32:32 +00:00
|
|
|
#undef E2
|
|
|
|
#undef E3
|
|
|
|
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+#ifndef CONFIG_PREEMPT_RT_FULL
|
|
|
|
+
|
|
|
|
/*
|
|
|
|
* read-lock / write-lock recursion that is actually safe.
|
|
|
|
*/
|
2019-04-08 23:49:20 +00:00
|
|
|
@@ -1028,6 +1053,8 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion_soft)
|
2018-08-27 14:32:32 +00:00
|
|
|
#undef E2
|
|
|
|
#undef E3
|
|
|
|
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
/*
|
|
|
|
* read-lock / write-lock recursion that is unsafe.
|
|
|
|
*/
|
2020-01-03 23:36:11 +00:00
|
|
|
--
|
2020-04-09 19:44:24 +00:00
|
|
|
2.25.1
|
2020-01-03 23:36:11 +00:00
|
|
|
|