Speaker
Description
The Common Clk Framework (CCF) is expected to keep a clock’s rate stable after setting a new rate with "clk_set_rate(clk, NEW_RATE)". However, several longstanding issues affect how rate changes propagate through the clock tree when CLK_SET_RATE_PARENT is involved.
Current behavior allows a child clock to change its parent’s rate to satisfy its own request, but this adjustment happens without considering sibling clocks. As a result:
-
A new parent rate may be incompatible with sibling or grandchild clocks, since no negotiation occurs across the tree.
-
Even when the parent rate is acceptable, sibling clocks can still have their rates changed unexpectedly. A proposed patch [1] to fix this cannot be merged without breaking boards that rely on the existing behavior.
-
Gate and mux scenarios raise further complications.
These limitations have been visible in some bug reports and attempted fixes over the years [2]. Recently-posted kunit tests [3] highlight and reproduce the issues.
We'll discuss the problem, some possible ways to solve this, and suggestions for how to keep compatibility with older boards that rely on the existing behavior.
[1] https://lore.kernel.org/linux-clk/20250528-clk-wip-v2-v2-2-0d2c2f220442@redhat.com/
[2]
- https://lore.kernel.org/lkml/20230825-pll-mipi_keep_rate-v1-0-35bc43570730@oltmanns.dev/
- https://lore.kernel.org/linux-kernel/20230807-pll-mipi_set_rate_parent-v6-0-f173239a4b59@oltmanns.dev/
- https://lore.kernel.org/all/20241114065759.3341908-1-victor.liu@nxp.com/
- https://lore.kernel.org/linux-clk/20241121-ge-ian-debug-imx8-clk-tree-v1-0-0f1b722588fe@bootlin.com/
[3] https://lore.kernel.org/linux-clk/20250812-clk-tests-docs-v3-0-054aed58dcd3@redhat.com/