From a6cf57dbaca832fe2aae78cc545d43cdd9a943aa Mon Sep 17 00:00:00 2001 From: dulibo1 Date: Wed, 15 Nov 2023 20:43:26 +0800 Subject: [PATCH] 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 --- drivers/clk/clk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index bf9fecc95b..099e508d14 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -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); } }