From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 2/3] plat: ti: k3: return 0 parents for clocks which only have a single parent
Date: Tue, 17 Jun 2025 11:01:41 +0200 [thread overview]
Message-ID: <20250617090142.3000882-3-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20250617090142.3000882-1-s.hauer@pengutronix.de>
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@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
next prev parent reply other threads:[~2025-06-17 9:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-17 9:01 [PATCH 0/3] TF-A: AM62lx: Fixes for barebox support Sascha Hauer
2025-06-17 9:01 ` [PATCH 1/3] plat: ti: k3: fix SCMI parent clock ids Sascha Hauer
2025-06-17 9:01 ` Sascha Hauer [this message]
2025-06-17 9:01 ` [PATCH 3/3] HACK: drop COPY_NAME_IDENTIFIER string length check Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250617090142.3000882-3-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox