diff options
author | Duoming Zhou <duoming@zju.edu.cn> | 2022-04-07 23:44:30 +0800 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2022-04-13 03:36:34 -0700 |
commit | eb5adc70754d26a260f8b42d39db42da0d0af500 (patch) | |
tree | 9ec355723ab991c97f26a64c195382d1f0bec852 /arch/xtensa/kernel/coprocessor.S | |
parent | ee69d4be8fd064cd08270b4808d2dfece3614ee0 (diff) | |
download | linux-eb5adc70754d26a260f8b42d39db42da0d0af500.tar.gz linux-eb5adc70754d26a260f8b42d39db42da0d0af500.tar.bz2 linux-eb5adc70754d26a260f8b42d39db42da0d0af500.zip |
arch: xtensa: platforms: Fix deadlock in rs_close()
There is a deadlock in rs_close(), which is shown
below:
(Thread 1) | (Thread 2)
| rs_open()
rs_close() | mod_timer()
spin_lock_bh() //(1) | (wait a time)
... | rs_poll()
del_timer_sync() | spin_lock() //(2)
(wait timer to stop) | ...
We hold timer_lock in position (1) of thread 1 and
use del_timer_sync() to wait timer to stop, but timer handler
also need timer_lock in position (2) of thread 2.
As a result, rs_close() will block forever.
This patch deletes the redundant timer_lock in order to
prevent the deadlock. Because there is no race condition
between rs_close, rs_open and rs_poll.
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Message-Id: <20220407154430.22387-1-duoming@zju.edu.cn>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/kernel/coprocessor.S')
0 files changed, 0 insertions, 0 deletions