Commit eb5adc7
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>1 parent ee69d4b commit eb5adc7
1 file changed
+0
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | | - | |
44 | 42 | | |
45 | 43 | | |
46 | | - | |
47 | 44 | | |
48 | 45 | | |
49 | 46 | | |
50 | 47 | | |
51 | 48 | | |
52 | 49 | | |
53 | | - | |
54 | 50 | | |
55 | 51 | | |
56 | | - | |
57 | 52 | | |
58 | 53 | | |
59 | 54 | | |
| |||
73 | 68 | | |
74 | 69 | | |
75 | 70 | | |
76 | | - | |
77 | | - | |
78 | 71 | | |
79 | 72 | | |
80 | 73 | | |
| |||
87 | 80 | | |
88 | 81 | | |
89 | 82 | | |
90 | | - | |
91 | 83 | | |
92 | 84 | | |
93 | 85 | | |
| |||
0 commit comments