esp32s3/rt_timer: Fix deadlock on RT-Timer thread.

The RT-Timer thread may call the `start_rt_timer` function. This
function gets the spinlock with interrupts disabled to ensure
exclusive access. However, this was already being performed in the
RT-Timer thread, causing a deadlock.
This commit is contained in:
Tiago Medicci Serrano 2023-12-22 16:22:34 -03:00 committed by Masayuki Ishikawa
parent 4761af7069
commit 823a183c17

View File

@ -572,10 +572,6 @@ static int rt_timer_thread(int argc, char *argv[])
kmm_free(timer);
}
/* Enter critical section for next scanning list */
flags = spin_lock_irqsave(&priv->lock);
if (raw_state == RT_TIMER_TIMEOUT)
{
/* Check if the timer is in "repeat" mode */
@ -585,6 +581,10 @@ static int rt_timer_thread(int argc, char *argv[])
start_rt_timer(timer, timer->timeout, true);
}
}
/* Enter critical section for next scanning list */
flags = spin_lock_irqsave(&priv->lock);
}
spin_unlock_irqrestore(&priv->lock, flags);