[PATCH 00/12] clk: Unit test clk unregistration paths

Stephen Boyd
2024-08-15T00:55:21Z

The clk_hw_unregister() path is rarely used and almost entirely
untested. Case in point, the first patch in this series that fixes a bug
due to unregistering a clk_hw and calling clk_put(). Add unit tests for
this code and test the consumer APIs to make sure the behavior stays
consistent.

The last patch is a WIP because I haven't gotten around to fixing all
the problems.

Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: Rae Moar <rmoar@google.com>

Nuno Sá (1):
clk: Fix clk not being unlinked from consumers list

Stephen Boyd (11):
clk: test: Introduce clk_hw_unregister_kunit()
clk: test: Introduce clk_put_kunit()
clk: Add tests for unregistering clk_hw and using consumer APIs
clk: Fail phase APIs after clk_hw is unregistered
clk: Test clk_get_phase() behavior after clk_hw is unregistered
clk: Fail duty cycle APIs after clk_hw is unregistered
clk: Test clk_set_duty_cycle() behavior after clk_hw is unregistered
clk: Prevent unregistered clk_hw from being reinserted into clk tree
clk: Test clk_set_parent() behavior after clk_hw is unregistered
clk: Test parent/clk flags combos while unregistering a clk_hw
WIP: clk: Test behavior of children clks after a parent is
unregistered

drivers/clk/clk.c | 26 +-
drivers/clk/clk_kunit_helpers.c | 46 ++
drivers/clk/clk_test.c | 720 ++++++++++++++++++++++++++++++++
include/kunit/clk.h | 2 +
4 files changed, 791 insertions(+), 3 deletions(-)

base-commit: 274aff8711b2e77c27bbda0ddc24caa39f154bfa