On 2.08.2023 00:10, Rafał Miłecki wrote: > Unfortunately enabling *any* of following options: > CONFIG_DEBUG_RT_MUTEXES=y > CONFIG_DEBUG_SPINLOCK=y > CONFIG_DEBUG_MUTEXES=y > seems to make locksup/hangs go away. I tried for few hours. I decided to find out why enabling CONFIG_DEBUG_MUTEXES "fixes" kernel / device stability for me. I tried enabling manually code that normally hides behind the #ifdev CONFIG_DEBUG_MUTEXES. Attached to this e-mail is a small patch that is enough to make my kernel stable (mutex-fix-bcm53573.diff). ##### It's not what's the most interesting thought. What really doesn't make sense anymore is that below diff (on top of attached one) brings back hangs/lockups. I triple checked that. Dropping a single unused function breaks kernel / device stability on BCM53573! AFAIK the only thing below diff actually affects is location of symbols (I actually verified that by comparing System.map before and after - over 22'000 of relocated symbols). Can some unfortunate location of symbols cause those hangs/lockups? diff --git a/kernel/locking/mutex-debug.c b/kernel/locking/mutex-debug.c index 4fe40910f..c440222a4 100644 --- a/kernel/locking/mutex-debug.c +++ b/kernel/locking/mutex-debug.c @@ -34,6 +34,8 @@ void debug_mutex_lock_common(struct mutex *lock, struct mutex_waiter *waiter) INIT_LIST_HEAD(&waiter->list); } +/* Dropping below function brings back hangs/lockups & reboots */ +#if 0 void debug_mutex_wake_waiter(struct mutex *lock, struct mutex_waiter *waiter) { lockdep_assert_held(&lock->wait_lock); @@ -41,6 +43,7 @@ void debug_mutex_wake_waiter(struct mutex *lock, struct mutex_waiter *waiter) DEBUG_LOCKS_WARN_ON(waiter->magic != waiter); DEBUG_LOCKS_WARN_ON(list_empty(&waiter->list)); } +#endif void debug_mutex_free_waiter(struct mutex_waiter *waiter) {