
Currently, ccf_clk_endisable() calls clk_enable() / clk_disable() directly depending on the request. However, this function is also referenced in clk->ops, which is also called in clk_enable() / clk_disable().
This caused a recursion and made the clock enabled twice if clk_enable() is invoked. So we have to call clk_disable() twice to disable the clock. It can be easily reproduced with few extra lines of debug code.
Fix that by calling clk->ops->enable/disable directly in ccf_clk_endisable() rather than using the framework functions.
Signed-off-by: Yang Xiwen forbidden405@outlook.com --- Yang Xiwen (2): clk: move clk_get_ops() to a common header clk: ccf: invoke ops provided by clk directly
drivers/clk/clk-uclass.c | 5 ----- drivers/clk/clk.c | 10 ++++++++-- include/clk.h | 17 +++++++++++++++++ 3 files changed, 25 insertions(+), 7 deletions(-) --- base-commit: 580eb31199be8a822e62f20965854a242f895d03 change-id: 20230724-clk_fix-1b7265d663a8
Best regards,