linux-imx/kernel/locking
Roland Xu 85f03ca98e rtmutex: Drop rt_mutex::wait_lock before scheduling
commit d33d26036a upstream.

rt_mutex_handle_deadlock() is called with rt_mutex::wait_lock held.  In the
good case it returns with the lock held and in the deadlock case it emits a
warning and goes into an endless scheduling loop with the lock held, which
triggers the 'scheduling in atomic' warning.

Unlock rt_mutex::wait_lock in the dead lock case before issuing the warning
and dropping into the schedule for ever loop.

[ tglx: Moved unlock before the WARN(), removed the pointless comment,
  	massaged changelog, added Fixes tag ]

Fixes: 3d5c9340d1 ("rtmutex: Handle deadlock detection smarter")
Signed-off-by: Roland Xu <mu001999@outlook.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/ME0P300MB063599BEF0743B8FA339C2CECC802@ME0P300MB0635.AUSP300.PROD.OUTLOOK.COM
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-09-12 11:11:25 +02:00
..
irqflag-debug.c
lock_events_list.h
lock_events.c
lock_events.h locking: add lockevent_read() prototype 2023-06-09 17:44:15 -07:00
lockdep_internals.h
lockdep_proc.c
lockdep_states.h
lockdep.c lockdep: Fix block chain corruption 2023-12-03 07:33:06 +01:00
locktorture.c torture: Add lock_torture writer_fifo module parameter 2023-08-14 15:01:07 -07:00
Makefile
mcs_spinlock.h
mutex-debug.c locking/mutex: Introduce devm_mutex_init() 2024-07-11 12:49:02 +02:00
mutex.c
mutex.h
osq_lock.c
percpu-rwsem.c
qrwlock.c
qspinlock_paravirt.h x86/qspinlock-paravirt: Fix missing-prototype warning 2023-08-03 17:15:05 +02:00
qspinlock_stat.h
qspinlock.c locking/qspinlock: Micro-optimize pending state waiting for unlock 2023-01-05 11:01:50 +01:00
rtmutex_api.c locking/rtmutex: Fix task->pi_waiters integrity 2023-07-17 13:59:10 +02:00
rtmutex_common.h locking/rtmutex: Fix task->pi_waiters integrity 2023-07-17 13:59:10 +02:00
rtmutex.c rtmutex: Drop rt_mutex::wait_lock before scheduling 2024-09-12 11:11:25 +02:00
rwbase_rt.c locking/rwbase: Mitigate indefinite writer starvation 2023-04-29 09:08:52 +02:00
rwsem.c locking/rwsem: Add __always_inline annotation to __down_write_common() and inlined callers 2024-08-03 08:53:42 +02:00
semaphore.c
spinlock_debug.c
spinlock_rt.c
spinlock.c
test-ww_mutex.c locking/ww_mutex/test: Fix potential workqueue corruption 2023-11-28 17:19:35 +00:00
ww_mutex.h locking/rtmutex: Fix task->pi_waiters integrity 2023-07-17 13:59:10 +02:00
ww_rt_mutex.c