diff --git a/drivers/retained_mem/Kconfig b/drivers/retained_mem/Kconfig index 8f134f94560b05..4ea7dcd8949287 100644 --- a/drivers/retained_mem/Kconfig +++ b/drivers/retained_mem/Kconfig @@ -16,13 +16,18 @@ config RETAINED_MEM_INIT_PRIORITY Retained memory devices initialization priority, config RETAINED_MEM_MUTEXES - bool "Retained memory mutex support" + bool default y depends on MULTITHREADING + depends on !RETAINED_MEM_MUTEX_FORCE_DISABLE + +config RETAINED_MEM_MUTEX_FORCE_DISABLE + bool "Disable retained memory mutex support" + depends on MULTITHREADING help - Use mutexes to prevent issues with concurrent retained memory access. - Should only be disabled whereby retained memory access is required - in an ISR or for special use cases. + Disable use of mutexes which prevent issues with concurrent retained + memory access. This option should only be enabled when retained + memory access is required in an ISR or for special use cases. module = RETAINED_MEM module-str = retained_mem diff --git a/subsys/retention/Kconfig b/subsys/retention/Kconfig index 1081e236f02b48..5322a11684911e 100644 --- a/subsys/retention/Kconfig +++ b/subsys/retention/Kconfig @@ -20,13 +20,18 @@ config RETENTION_INIT_PRIORITY priorities for retained memory drivers. config RETENTION_MUTEXES - bool "Retention mutex support" + bool default y depends on MULTITHREADING + depends on !RETENTION_MUTEX_FORCE_DISABLE + +config RETENTION_MUTEX_FORCE_DISABLE + bool "Disable retention mutex support" + depends on MULTITHREADING help - Use mutexes to prevent issues with concurrent retention device - access. Should only be disabled whereby retained memory access is - required in an ISR or for special use cases. + Disable use of mutexes which prevent issues with concurrent retention + device access. This option should only be enabled when retention + access is required in an ISR or for special use cases. config RETENTION_BUFFER_SIZE int "Retention stack buffer sizes"