clk:change lock to recursive lock

case:
clk_set_rate ->
clk->ops->round_rate ->
divider_round_rate ->
clk_divider_bestdiv->
clk_round_rate

this path casue  recursive clk_list_lock

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
This commit is contained in:
dulibo1 2023-11-15 20:43:26 +08:00 committed by Xiang Xiao
parent d5fdeffd06
commit a6cf57dbac

View file

@ -45,7 +45,7 @@
* Private Datas
****************************************************************************/
static mutex_t g_clk_list_lock = NXMUTEX_INITIALIZER;
static rmutex_t g_clk_list_lock = NXRMUTEX_INITIALIZER;
static struct list_node g_clk_root_list
= LIST_INITIAL_VALUE(g_clk_root_list);
@ -322,7 +322,7 @@ static irqstate_t clk_list_lock(void)
{
if (!up_interrupt_context() && !sched_idletask())
{
nxmutex_lock(&g_clk_list_lock);
nxrmutex_lock(&g_clk_list_lock);
}
return enter_critical_section();
@ -334,7 +334,7 @@ static void clk_list_unlock(irqstate_t flags)
if (!up_interrupt_context() && !sched_idletask())
{
nxmutex_unlock(&g_clk_list_lock);
nxrmutex_unlock(&g_clk_list_lock);
}
}