diff options
| -rw-r--r-- | kernel/lockdep.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 270cfa405d39..27c609f3eae5 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
| @@ -2158,6 +2158,24 @@ static void check_chain_key(struct task_struct *curr) | |||
| 2158 | #endif | 2158 | #endif |
| 2159 | } | 2159 | } |
| 2160 | 2160 | ||
| 2161 | static void | ||
| 2162 | print_usage_bug_scenario(struct held_lock *lock) | ||
| 2163 | { | ||
| 2164 | struct lock_class *class = hlock_class(lock); | ||
| 2165 | |||
| 2166 | printk(" Possible unsafe locking scenario:\n\n"); | ||
| 2167 | printk(" CPU0\n"); | ||
| 2168 | printk(" ----\n"); | ||
| 2169 | printk(" lock("); | ||
| 2170 | __print_lock_name(class); | ||
| 2171 | printk(");\n"); | ||
| 2172 | printk(" <Interrupt>\n"); | ||
| 2173 | printk(" lock("); | ||
| 2174 | __print_lock_name(class); | ||
| 2175 | printk(");\n"); | ||
| 2176 | printk("\n *** DEADLOCK ***\n\n"); | ||
| 2177 | } | ||
| 2178 | |||
| 2161 | static int | 2179 | static int |
| 2162 | print_usage_bug(struct task_struct *curr, struct held_lock *this, | 2180 | print_usage_bug(struct task_struct *curr, struct held_lock *this, |
| 2163 | enum lock_usage_bit prev_bit, enum lock_usage_bit new_bit) | 2181 | enum lock_usage_bit prev_bit, enum lock_usage_bit new_bit) |
| @@ -2186,6 +2204,8 @@ print_usage_bug(struct task_struct *curr, struct held_lock *this, | |||
| 2186 | 2204 | ||
| 2187 | print_irqtrace_events(curr); | 2205 | print_irqtrace_events(curr); |
| 2188 | printk("\nother info that might help us debug this:\n"); | 2206 | printk("\nother info that might help us debug this:\n"); |
| 2207 | print_usage_bug_scenario(this); | ||
| 2208 | |||
| 2189 | lockdep_print_held_locks(curr); | 2209 | lockdep_print_held_locks(curr); |
| 2190 | 2210 | ||
| 2191 | printk("\nstack backtrace:\n"); | 2211 | printk("\nstack backtrace:\n"); |
