forked from nuttx/nuttx-update
esp32s3/i2s: Fix faulty initialization when SMP is enabled
The buffer initialization function (`i2s_buf_initialize`) calls `i2s_buf_free`, which performs buffer initialization within a critical section (`spin_lock_irqsave`). If this function is called under the same critical section (same spinlock), initialization will hang.
This commit is contained in:
parent
1ab1a905b8
commit
c91599d34c
2 changed files with 6 additions and 4 deletions
|
@ -3162,10 +3162,6 @@ struct i2s_dev_s *esp32s3_i2sbus_initialize(int port)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
flags = spin_lock_irqsave(&priv->slock);
|
||||
|
||||
i2s_configure(priv);
|
||||
|
||||
/* Allocate buffer containers */
|
||||
|
||||
ret = i2s_buf_initialize(priv);
|
||||
|
@ -3174,6 +3170,10 @@ struct i2s_dev_s *esp32s3_i2sbus_initialize(int port)
|
|||
goto err;
|
||||
}
|
||||
|
||||
flags = spin_lock_irqsave(&priv->slock);
|
||||
|
||||
i2s_configure(priv);
|
||||
|
||||
ret = i2s_dma_setup(priv);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
|
|
@ -83,6 +83,8 @@ CONFIG_RAM_SIZE=114688
|
|||
CONFIG_RAM_START=0x20000000
|
||||
CONFIG_RR_INTERVAL=200
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_SMP_NCPUS=2
|
||||
CONFIG_SPIFFS_NAME_MAX=128
|
||||
CONFIG_START_DAY=6
|
||||
CONFIG_START_MONTH=12
|
||||
|
|
Loading…
Reference in a new issue