[PATCH 0/8] clk: test: add tests for inconsistencies and limitations in the framework

Brian Masney posted 8 patches 10 months ago
drivers/clk/clk_test.c | 601 +++++++++++++++++++++++++++++++++++------
1 file changed, 513 insertions(+), 88 deletions(-)
[PATCH 0/8] clk: test: add tests for inconsistencies and limitations in the framework
Posted by Brian Masney 10 months ago
Here's a series that introduces some clock provider kunit tests. These
tests are centered around inconsistencies and limitations in the clock
framework that may lead to some clocks unknowingly changing rates during
a rate change of their siblings.

The intent of the clock framework is to keep the siblings clock rate
stable during such an operation:

    clk_set_rate(clk, MY_NEW_RATE);

However, it assumes that the sibling can generate that rate in the first
place. In many situations, it can't, and it leads to numerous bugs and
solutions over the years.

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/

We intend to fix these issues, but first we need to agree and document
what these shortcomings are. These patches are meant to do that, even
though some will be skipped as they are currently broken.

Special thanks to Maxime Ripard for the guidance and feedback on this
project so far.

Brian Masney (8):
  clk: test: introduce a few specific rate constants for mock testing
  clk: test: introduce clk_dummy_div for a mock divider
  clk: test: introduce test suite for sibling rate changes on a divider
  clk: test: introduce clk_dummy_gate for a mock gate
  clk: test: introduce test suite for sibling rate changes on a gate
  clk: test: introduce helper to create a mock mux
  clk: test: introduce test variation for sibling rate changes on a mux
  clk: test: introduce test variation for sibling rate changes on a
    gate/mux

 drivers/clk/clk_test.c | 601 +++++++++++++++++++++++++++++++++++------
 1 file changed, 513 insertions(+), 88 deletions(-)

-- 
2.49.0
Re: [PATCH 0/8] clk: test: add tests for inconsistencies and limitations in the framework
Posted by Brian Masney 8 months, 2 weeks ago
On Mon, Apr 07, 2025 at 09:12:50AM -0400, Brian Masney wrote:
> Here's a series that introduces some clock provider kunit tests. These
> tests are centered around inconsistencies and limitations in the clock
> framework that may lead to some clocks unknowingly changing rates during
> a rate change of their siblings.

I posted a v2 of this series with a new title for the cover letter. This
combines another series related to fixing an issue in the clk core.

https://lore.kernel.org/lkml/20250528-clk-wip-v2-v2-0-0d2c2f220442@redhat.com/T/#t

Brian