clk: fix a bug in CCF which results in a clock being enabled twice.
Get series with b4
b4 am [email protected] change-id 20230724-clk_fix-1b7265d663a8Versions newest first
- v1 Latest2 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | clk: move clk_get_ops() to a common headerdrivers/ include/ | +17 | 0 replies | |
| 2/2 | clk: ccf: invoke ops provided by clk directlydrivers/ | +8 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] clk: fix a bug in CCF which results in a clock being enabled twice.
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.
---
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,
Signature · 1 line
Yang Xiwen <[email protected]>