Thread (8 messages) 8 messages, 2 authors, 2026-03-11

Re: [PATCH v8 4/6] clk: Add KUnit tests for assigned-clock-sscs

From: Brian Masney <bmasney@redhat.com>
Date: 2026-03-11 21:50:16
Also in: arm-scmi, linux-clk, linux-devicetree, lkml

Hi Peng,

On Mon, Mar 02, 2026 at 11:01:18PM +0800, Peng Fan (OSS) wrote:
From: Peng Fan <peng.fan@nxp.com>

Spread spectrum configuration is part of clock frequency settings,
and its behavior can be validated similarly to assigned clock rates.

Extend the existing KUnit tests for assigned-clock-rates to cover
assigned-clock-sscs by reusing the test framework. Add new test
device trees:
  - kunit_clk_assigned_sscs_null.dtso
  - kunit_clk_assigned_sscs_null_consumer.dtso
  - kunit_clk_assigned_sscs_without.dtso
  - kunit_clk_assigned_sscs_without_consumer.dtso
  - kunit_clk_assigned_sscs_zero.dtso
  - kunit_clk_assigned_sscs_zero_consumer.dtso

These tests cover various invalid configurations of assigned-clock-sscs,
ensuring robustness and consistent error handling, similar to the coverage
provided for assigned-clock-rates.

Co-developed-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Reviewed-by: Sebin Francis <redacted>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
I'm collecting up patches for Stephen for a git pull. I wanted to
include this series, however I see that the clk kunit tests fail.

[17:34:44] ================= clk_assigned_sscs_skips  =================
[17:34:44] [FAILED] provider missing assigned-clocks
[17:34:44] # clk_assigned_sscs_skips: ASSERTION FAILED at drivers/clk/clk_test.c:3218
[17:34:44] Expected 0 == of_clk_set_defaults(consumer, false), but
[17:34:44]     of_clk_set_defaults(consumer, false) == -2 (0xfffffffffffffffe)
[17:34:44] [FAILED] consumer missing assigned-clocks
[17:34:44] [PASSED] provider assigned-clock-sscs of zero
[17:34:44] [PASSED] consumer assigned-clock-sscs of zero
[17:34:44] # clk_assigned_sscs_skips: ASSERTION FAILED at drivers/clk/clk_test.c:3194
[17:34:44] Expected 0 == of_clk_add_hw_provider_kunit(test, np, of_clk_hw_simple_get, &ctx->clk0.hw), but
[17:34:44]     of_clk_add_hw_provider_kunit(test, np, of_clk_hw_simple_get, &ctx->clk0.hw) == -2 (0xfffffffffffffffe)
[17:34:44] [FAILED] provider assigned-clocks null phandle
[17:34:44] # clk_assigned_sscs_skips: ASSERTION FAILED at drivers/clk/clk_test.c:3218
[17:34:44] Expected 0 == of_clk_set_defaults(consumer, false), but
[17:34:44]     of_clk_set_defaults(consumer, false) == -2 (0xfffffffffffffffe)
[17:34:44] [FAILED] provider assigned-clocks null phandle
[17:34:44] # clk_assigned_sscs_skips: ASSERTION FAILED at drivers/clk/clk_test.c:3194
[17:34:44] Expected 0 == of_clk_add_hw_provider_kunit(test, np, of_clk_hw_simple_get, &ctx->clk0.hw), but
[17:34:44]     of_clk_add_hw_provider_kunit(test, np, of_clk_hw_simple_get, &ctx->clk0.hw) == -2 (0xfffffffffffffffe)
[17:34:44] # clk_assigned_sscs_skips: pass:2 fail:4 skip:0 total:6
[17:34:44] ============= [FAILED] clk_assigned_sscs_skips =============
[17:34:44]     # module: clk_test
[17:34:44] # clk_assigned_rates: pass:3 fail:1 skip:0 total:4
[17:34:44] # Totals: pass:16 fail:4 skip:0 total:20
[17:34:44] =============== [FAILED] clk_assigned_rates ================

Can you look into this? I didn't look in detail, but should the tests be
updated to expect -ENOENT in some cases, such as 'consumer missing
assigned-clocks'?

Brian

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help