Commit 9fb1b90ce0a847a8cc9492a6c1f347b5be1f33ff
Committed by
Ingo Molnar
1 parent
6617feca15
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
lockdep: Selftest: convert spinlock to raw spinlock
To make the lockdep selftest working on RT we need to convert the spinlock tests to a raw spinlock. Otherwise we cannot run the irq context checks. For mainline this is just annotational as spinlocks are mapped to raw_spinlocks anyway. Signed-off-by: Yong Zhang <yong.zhang0@gmail.com> Link: http://lkml.kernel.org/r/1334559716-18447-2-git-send-email-yong.zhang0@gmail.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Showing 1 changed file with 17 additions and 17 deletions Side-by-side Diff
lib/locking-selftest.c
... | ... | @@ -47,10 +47,10 @@ |
47 | 47 | * Normal standalone locks, for the circular and irq-context |
48 | 48 | * dependency tests: |
49 | 49 | */ |
50 | -static DEFINE_SPINLOCK(lock_A); | |
51 | -static DEFINE_SPINLOCK(lock_B); | |
52 | -static DEFINE_SPINLOCK(lock_C); | |
53 | -static DEFINE_SPINLOCK(lock_D); | |
50 | +static DEFINE_RAW_SPINLOCK(lock_A); | |
51 | +static DEFINE_RAW_SPINLOCK(lock_B); | |
52 | +static DEFINE_RAW_SPINLOCK(lock_C); | |
53 | +static DEFINE_RAW_SPINLOCK(lock_D); | |
54 | 54 | |
55 | 55 | static DEFINE_RWLOCK(rwlock_A); |
56 | 56 | static DEFINE_RWLOCK(rwlock_B); |
... | ... | @@ -73,12 +73,12 @@ |
73 | 73 | * but X* and Y* are different classes. We do this so that |
74 | 74 | * we do not trigger a real lockup: |
75 | 75 | */ |
76 | -static DEFINE_SPINLOCK(lock_X1); | |
77 | -static DEFINE_SPINLOCK(lock_X2); | |
78 | -static DEFINE_SPINLOCK(lock_Y1); | |
79 | -static DEFINE_SPINLOCK(lock_Y2); | |
80 | -static DEFINE_SPINLOCK(lock_Z1); | |
81 | -static DEFINE_SPINLOCK(lock_Z2); | |
76 | +static DEFINE_RAW_SPINLOCK(lock_X1); | |
77 | +static DEFINE_RAW_SPINLOCK(lock_X2); | |
78 | +static DEFINE_RAW_SPINLOCK(lock_Y1); | |
79 | +static DEFINE_RAW_SPINLOCK(lock_Y2); | |
80 | +static DEFINE_RAW_SPINLOCK(lock_Z1); | |
81 | +static DEFINE_RAW_SPINLOCK(lock_Z2); | |
82 | 82 | |
83 | 83 | static DEFINE_RWLOCK(rwlock_X1); |
84 | 84 | static DEFINE_RWLOCK(rwlock_X2); |
85 | 85 | |
... | ... | @@ -107,10 +107,10 @@ |
107 | 107 | */ |
108 | 108 | #define INIT_CLASS_FUNC(class) \ |
109 | 109 | static noinline void \ |
110 | -init_class_##class(spinlock_t *lock, rwlock_t *rwlock, struct mutex *mutex, \ | |
111 | - struct rw_semaphore *rwsem) \ | |
110 | +init_class_##class(raw_spinlock_t *lock, rwlock_t *rwlock, \ | |
111 | + struct mutex *mutex, struct rw_semaphore *rwsem)\ | |
112 | 112 | { \ |
113 | - spin_lock_init(lock); \ | |
113 | + raw_spin_lock_init(lock); \ | |
114 | 114 | rwlock_init(rwlock); \ |
115 | 115 | mutex_init(mutex); \ |
116 | 116 | init_rwsem(rwsem); \ |
117 | 117 | |
... | ... | @@ -168,10 +168,10 @@ |
168 | 168 | * Shortcuts for lock/unlock API variants, to keep |
169 | 169 | * the testcases compact: |
170 | 170 | */ |
171 | -#define L(x) spin_lock(&lock_##x) | |
172 | -#define U(x) spin_unlock(&lock_##x) | |
171 | +#define L(x) raw_spin_lock(&lock_##x) | |
172 | +#define U(x) raw_spin_unlock(&lock_##x) | |
173 | 173 | #define LU(x) L(x); U(x) |
174 | -#define SI(x) spin_lock_init(&lock_##x) | |
174 | +#define SI(x) raw_spin_lock_init(&lock_##x) | |
175 | 175 | |
176 | 176 | #define WL(x) write_lock(&rwlock_##x) |
177 | 177 | #define WU(x) write_unlock(&rwlock_##x) |
... | ... | @@ -911,7 +911,7 @@ |
911 | 911 | |
912 | 912 | #define I2(x) \ |
913 | 913 | do { \ |
914 | - spin_lock_init(&lock_##x); \ | |
914 | + raw_spin_lock_init(&lock_##x); \ | |
915 | 915 | rwlock_init(&rwlock_##x); \ |
916 | 916 | mutex_init(&mutex_##x); \ |
917 | 917 | init_rwsem(&rwsem_##x); \ |