Commit 05597d7
mpsl: pm: Fix MPSL Pl uninit -NRF_ETIMEDOUT
There was a lock if a MPSL PM was uninitialized by
mpsl_lib_uninit() from hci_driver.c hci_driver_close().
The hci_driver_close() locks multi-threading by call
MULTITHREADING_LOCK_ACQUIRE(). The same mutex is acquired
by MPSL mpsl_low_prio_work_handler. The MPSL PM used
an uninit work item that was scheduled to MPSL low prio work
queue. The work was never executed during the MPSL PM uninit,
even though the uninit was waiting on a semaphore.
That was a lock that caused -NRF_ETIMEDOUT error to be
returned.
The mpsl_pm_uninit function can't be called without earlier
MULTITHREADING_LOCK_ACQUIRE() call. That is a prerequisite
to be fulfilled by a user.
On the other hand, the use of the lock allows to stop
using a work item during uninitialization of the MPSL PM.
The is not needed because if there is any work item in
the queue, then it will be handled after uninit is done.
It will have no effect on PM subsystem. These items will
be just removed from the MPSL work queue.
Signed-off-by: Piotr Pryga <[email protected]>1 parent 129d7fc commit 05597d7
File tree
6 files changed
+13
-196
lines changed- subsys/mpsl/pm
- tests/subsys/mpsl/pm
6 files changed
+13
-196
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 18 | | |
26 | 19 | | |
27 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | 23 | | |
33 | 24 | | |
34 | 25 | | |
35 | | - | |
36 | 26 | | |
37 | 27 | | |
38 | 28 | | |
| |||
43 | 33 | | |
44 | 34 | | |
45 | 35 | | |
46 | | - | |
47 | 36 | | |
48 | 37 | | |
49 | 38 | | |
| |||
214 | 203 | | |
215 | 204 | | |
216 | 205 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | 206 | | |
225 | 207 | | |
226 | 208 | | |
227 | 209 | | |
228 | 210 | | |
229 | 211 | | |
230 | 212 | | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | 213 | | |
248 | 214 | | |
249 | 215 | | |
| |||
271 | 237 | | |
272 | 238 | | |
273 | 239 | | |
274 | | - | |
275 | | - | |
276 | 240 | | |
277 | 241 | | |
278 | 242 | | |
279 | 243 | | |
280 | 244 | | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | 245 | | |
289 | | - | |
290 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
291 | 249 | | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
299 | 254 | | |
300 | 255 | | |
301 | 256 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | | - | |
43 | 41 | | |
44 | 42 | | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | | - | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
| |||
55 | 53 | | |
56 | 54 | | |
57 | 55 | | |
58 | | - | |
59 | | - | |
| 56 | + | |
| 57 | + | |
60 | 58 | | |
61 | | - | |
62 | | - | |
63 | 59 | | |
64 | 60 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | 61 | | |
83 | 62 | | |
84 | 63 | | |
85 | 64 | | |
86 | 65 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 66 | + | |
104 | 67 | | |
105 | 68 | | |
106 | 69 | | |
| |||
136 | 99 | | |
137 | 100 | | |
138 | 101 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | 102 | | |
153 | 103 | | |
154 | 104 | | |
155 | 105 | | |
156 | 106 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | 107 | | |
202 | 108 | | |
203 | 109 | | |
| |||
0 commit comments