mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 05:42:05 +08:00
arch/xtensa: add critical section on e-fuse bringup
The efuse initialization requires critical section to avoid a very hidden corner case when flash encryption is enabled. Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
This commit is contained in:
committed by
simbit18
parent
151776f0a5
commit
8f42a6f6d7
@@ -286,6 +286,7 @@ int esp_efuse_initialize(const char *devpath)
|
||||
{
|
||||
struct esp_efuse_lowerhalf_s *lower = NULL;
|
||||
int ret = OK;
|
||||
irqstate_t flags;
|
||||
|
||||
DEBUGASSERT(devpath != NULL);
|
||||
|
||||
@@ -293,6 +294,7 @@ int esp_efuse_initialize(const char *devpath)
|
||||
|
||||
/* Register the efuse upper driver */
|
||||
|
||||
flags = enter_critical_section();
|
||||
lower->upper = efuse_register(devpath,
|
||||
(struct efuse_lowerhalf_s *)lower);
|
||||
|
||||
@@ -312,6 +314,7 @@ int esp_efuse_initialize(const char *devpath)
|
||||
esp_efuse_utility_update_virt_blocks();
|
||||
#endif
|
||||
|
||||
leave_critical_section(flags);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user