@@ -85,6 +85,7 @@ void static_key_slow_inc_cpuslocked(struct static_key *key)
85
85
int v , v1 ;
86
86
87
87
STATIC_KEY_CHECK_USE (key );
88
+ lockdep_assert_cpus_held ();
88
89
89
90
/*
90
91
* Careful if we get concurrent static_key_slow_inc() calls;
@@ -130,6 +131,7 @@ EXPORT_SYMBOL_GPL(static_key_slow_inc);
130
131
void static_key_enable_cpuslocked (struct static_key * key )
131
132
{
132
133
STATIC_KEY_CHECK_USE (key );
134
+ lockdep_assert_cpus_held ();
133
135
134
136
if (atomic_read (& key -> enabled ) > 0 ) {
135
137
WARN_ON_ONCE (atomic_read (& key -> enabled ) != 1 );
@@ -160,6 +162,7 @@ EXPORT_SYMBOL_GPL(static_key_enable);
160
162
void static_key_disable_cpuslocked (struct static_key * key )
161
163
{
162
164
STATIC_KEY_CHECK_USE (key );
165
+ lockdep_assert_cpus_held ();
163
166
164
167
if (atomic_read (& key -> enabled ) != 1 ) {
165
168
WARN_ON_ONCE (atomic_read (& key -> enabled ) != 0 );
@@ -185,6 +188,8 @@ static void __static_key_slow_dec_cpuslocked(struct static_key *key,
185
188
unsigned long rate_limit ,
186
189
struct delayed_work * work )
187
190
{
191
+ lockdep_assert_cpus_held ();
192
+
188
193
/*
189
194
* The negative count check is valid even when a negative
190
195
* key->enabled is in use by static_key_slow_inc(); a
0 commit comments