Commit 0479f08
mpsl: clock_ctrl: Fix wait for LFCLK if timeout returned earlier
There is a workaround implemented in the MPSL clock control
integration layer for cases where nrf2 clock control doesn't
get response from sysctrl for the LFCLK request.
The workaround was incorrectly implemented. After clock driver
returned -NRF_ETIMEDOUT new call to m_lfclk_wait() was done.
The new call waits on a semaphore that also returns timeout error.
The second m_lfclk_wait() call returns -NRF_EFAULT error code that
causes an assert in later stage of initialization.
The change done is to make sure if a clock driver returns
-NRF_ETIMEDOUT error for m_lfclk_wait then next m_lfclk_wait call
immediately returns 0 (as if the clock was ready). That is based
on an assumption:
- the sysctrl implicitly provides a LFCLK with accuracy that is
the same or better than requested by MPSL,
- there are not other LFLCK requests from Radio core FW
- if there is another LFCLK request put, it is for a LFCLK with
accuracy the same or better than required by radio protocols.
The change also affects LFCLK request and response APIs, so that
the new requests or released for the clock will return immediately
until the mpsl_clock_ctrl_uninit() is executed, that resets the sate
of the m_lflclk_req_timeout flag.
There is added a KConfig option: CONFIG_MPSL_EXT_CLK_CTRL_LFCLK_REQ-
_TIMEOUT_ALLOW that can be used to disable the workaround.
Signed-off-by: Piotr Pryga <[email protected]>1 parent 803c382 commit 0479f08
2 files changed
+75
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
39 | 51 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
139 | 143 | | |
140 | 144 | | |
141 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
142 | 157 | | |
143 | 158 | | |
144 | | - | |
145 | | - | |
| 159 | + | |
| 160 | + | |
146 | 161 | | |
147 | 162 | | |
148 | 163 | | |
149 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
150 | 173 | | |
151 | 174 | | |
152 | 175 | | |
| 176 | + | |
153 | 177 | | |
154 | 178 | | |
155 | 179 | | |
| |||
304 | 328 | | |
305 | 329 | | |
306 | 330 | | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
307 | 342 | | |
308 | 343 | | |
309 | 344 | | |
| |||
322 | 357 | | |
323 | 358 | | |
324 | 359 | | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
325 | 374 | | |
326 | 375 | | |
327 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
328 | 384 | | |
329 | 385 | | |
330 | 386 | | |
| |||
469 | 525 | | |
470 | 526 | | |
471 | 527 | | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
472 | 533 | | |
473 | 534 | | |
0 commit comments