Commit 304cf02
[nrf fromtree] drivers: nrf_qspi_nor: Fix EXTXIP + Flash write race condition
When parts of code are running from EXTXIP and at the same
time QSPI external flash writes/erases are happenning there
is a high risk of a race condition where a thread running
EXTXIP code starts executing while an external flash operation
is in progress; This can lead to execution stalling or
bus faults/usage faults.
The issue was observed when parts of MCUMGR were relocated to
EXTXIP and DFU was performed.
To fix the issue added the CONFIG_NORDIC_QSPI_NOR_XIP_FLASH_SCHED_LOCK
option which should be used when executing parts of code from EXTXIP.
It ensures the blocking variant of nrfx_qspi_ is used and that
no preemption happens while an external flash write is in progress
(by making qspi_wait_while_writing blocking)
Signed-off-by: Artur Hadasz <artur.hadasz@nordicsemi.no>
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
(cherry picked from commit 318948b)1 parent f7722b5 commit 304cf02
2 files changed
Lines changed: 55 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
55 | 67 | | |
56 | 68 | | |
57 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
353 | 358 | | |
354 | 359 | | |
355 | 360 | | |
| |||
366 | 371 | | |
367 | 372 | | |
368 | 373 | | |
| 374 | + | |
369 | 375 | | |
370 | 376 | | |
371 | 377 | | |
| |||
377 | 383 | | |
378 | 384 | | |
379 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
380 | 400 | | |
381 | 401 | | |
382 | 402 | | |
| |||
392 | 412 | | |
393 | 413 | | |
394 | 414 | | |
| 415 | + | |
395 | 416 | | |
396 | 417 | | |
397 | 418 | | |
| |||
484 | 505 | | |
485 | 506 | | |
486 | 507 | | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
487 | 512 | | |
488 | | - | |
489 | 513 | | |
| 514 | + | |
| 515 | + | |
490 | 516 | | |
491 | 517 | | |
492 | 518 | | |
| |||
974 | 1000 | | |
975 | 1001 | | |
976 | 1002 | | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
977 | 1007 | | |
978 | 1008 | | |
979 | 1009 | | |
| |||
989 | 1019 | | |
990 | 1020 | | |
991 | 1021 | | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
992 | 1026 | | |
993 | 1027 | | |
994 | 1028 | | |
| |||
1020 | 1054 | | |
1021 | 1055 | | |
1022 | 1056 | | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
1023 | 1061 | | |
1024 | 1062 | | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
1025 | 1067 | | |
1026 | 1068 | | |
1027 | 1069 | | |
| |||
0 commit comments