The warning was intended to spot complete_all() users from hardirq context on PREEMPT_RT. The warning as-is will also trigger in interrupt handlers, which are threaded on PREEMPT_RT, which was not intended. Use lockdep_assert_RT_in_threaded_ctx() which triggers in non-preemptive context on PREEMPT_RT.
Unified · Split
| @@ -711,6 +711,21 @@ do { \ · 710 unmodified lines | |||
| 711 | # define lockdep_assert_in_irq() do { } while (0) | 711 | # define lockdep_assert_in_irq() do { } while (0) |
| 712 | #endif | 712 | #endif |
| 713 | 713 | ||
| 714 | #ifdef CONFIG_PROVE_RAW_LOCK_NESTING | ||
| 715 | |||
| 716 | # define lockdep_assert_RT_in_threaded_ctx() do { \ | ||
| 717 | WARN_ONCE(debug_locks && !current->lockdep_recursion && \ | ||
| 718 | current->hardirq_context && \ | ||
| 719 | !(current->hardirq_threaded || current->irq_config), \ | ||
| 720 | "Not in threaded context on PREEMPT_RT as expected\n"); \ | ||
| 721 | } while (0) | ||
| 722 | |||
| 723 | #else | ||
| 724 | |||
| 725 | # define lockdep_assert_RT_in_threaded_ctx() do { } while (0) | ||
| 726 | |||
| 727 | #endif | ||
| 728 | |||
| 714 | #ifdef CONFIG_LOCKDEP | 729 | #ifdef CONFIG_LOCKDEP |
| 715 | void lockdep_rcu_suspicious(const char *file, const int line, const char *s); | 730 | void lockdep_rcu_suspicious(const char *file, const int line, const char *s); |
| 716 | #else | 731 | #else |
| @@ -58,7 +58,7 @@ void complete_all(struct completion *x) · 57 unmodified lines | |||
| 58 | { | 58 | { |
| 59 | unsigned long flags; | 59 | unsigned long flags; |
| 60 | 60 | ||
| 61 | WARN_ON(irqs_disabled()); | 61 | lockdep_assert_RT_in_threaded_ctx(); |
| 62 | 62 | ||
| 63 | raw_spin_lock_irqsave(&x->wait.lock, flags); | 63 | raw_spin_lock_irqsave(&x->wait.lock, flags); |
| 64 | x->done = UINT_MAX; | 64 | x->done = UINT_MAX; |