[PATCH 2/3] plat: ti: k3: return 0 parents for clocks which only have a single parent

Sascha Hauer s.hauer at pengutronix.de
Tue Jun 17 02:01:41 PDT 2025


Some clocks return one parent in their get_num_clock_parents() hook, but
if asked for this parent it returns an error which goes down to
device_clk_get_parent() where we have:

	if (!fail && (clock_data->type != DEV_CLK_TABLE_TYPE_MUX)) {
		fail = true;
	}

A clock with only one parent is not a mux, but why should it be not
allowed to to have a parent? This code all looks strange and I suspect
more problems here. For now just report clocks with a single parent as
clocks without parent.

Change-Id: I6d120e6774b6b630e86ce921891823715126a905
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 plat/ti/k3/common/drivers/scmi/scmi_clock.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/plat/ti/k3/common/drivers/scmi/scmi_clock.c b/plat/ti/k3/common/drivers/scmi/scmi_clock.c
index afda3f05b..9eee60e69 100644
--- a/plat/ti/k3/common/drivers/scmi/scmi_clock.c
+++ b/plat/ti/k3/common/drivers/scmi/scmi_clock.c
@@ -160,6 +160,9 @@ int32_t plat_scmi_clock_get_possible_parents(unsigned int agent_id,
 
 	*nb_elts = (uint64_t)scmi_handler_clock_get_num_clock_parents(clock->dev_id,
 									clock->clock_id);
+	if (*nb_elts == 1)
+		*nb_elts = 0;
+
 	if (plat_possible_parents) {
 		for (uint32_t i = 0; i < (uint32_t)*nb_elts ; i++) {
 			plat_possible_parents[i] = i + scmi_id + 1;
-- 
2.39.5




More information about the barebox mailing list