From: Cristian Marussi <cristian.marussi@arm.com>
To: Peng Fan <peng.fan@nxp.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
Cristian Marussi <cristian.marussi@arm.com>,
Souvik Chakravarty <souvik.chakravarty@arm.com>,
"open list:SYSTEM CONTROL & POWER/MANAGEMENT INTERFACE"
<arm-scmi@vger.kernel.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dhruva Gole <d-gole@ti.com>,
"Francis, Sebin" <sebin.francis@ti.com>,
Ranjani Vaidyanathan <ranjani.vaidyanathan@nxp.com>
Subject: Re: SCMI Clock Protocol: clk_round_rate() mismatch with actual get_rate() results
Date: Fri, 31 Oct 2025 19:23:26 +0000 [thread overview]
Message-ID: <aQUMrmJ4tX-i7pIS@pluto> (raw)
In-Reply-To: <PAXPR04MB84594F6E2CE36C0EA1EAE24D88FBA@PAXPR04MB8459.eurprd04.prod.outlook.com>
On Thu, Oct 30, 2025 at 02:36:14AM +0000, Peng Fan wrote:
> Hi all,
>
Hi Peng,
> I'm encountering an issue with the SCMI Clock Protocol implementation in
> Linux where clk_round_rate() returns a value that matches the expected
> rate, but after calling clk_set_rate(), the actual rate retrieved via
> clk_get_rate() differs significantly. This discrepancy is causing problems
> for video modes that require precise pixel clock frequencies.
>
> Here are some examples:
> 1) Expected: 148500000, Rounded: 148500000, Set: 148500000, Get: 148444444
> 2) Expected: 148352000, Rounded: 148352000, Set: 148352000, Get: 111333333
> 3) Expected: 74250000, Rounded: 74250000, Set: 74250000, Get: 74222222
> 4) Expected: 74176000, Rounded: 74176000, Set: 74176000, Get: 63619047
>
> From what I understand, SCMI does not support a dedicated round_rate
> protocol operation. The Linux SCMI clk driver uses the initial clock attributes
> (either a discrete rate list or a min/max range) to implement clk_round_rate(),
> but this does not reflect the actual rate that will be set by the firmware. As a
> result, clk_round_rate() often returns the expected value, but clk_get_rate()
> shows a different result after clk_set_rate().
>
> This behavior breaks video drivers that rely on precise clock rates for mode
> validation and setup.
>
> SCMI supports clock parent relationships, and the Linux SCMI clk driver
> correctly builds the clock tree using this information. But when set rate,
> it will not propagate to parent, because determine_rate() is there
> for all scmi clks.
>
> Questions:
>
> Is there any plan to enhance SCMI to support accurate rate
> rounding or feedback?
> Would it be feasible for the SCMI clk driver to verify the
> actual rate after set_rate() and adjust accordingly?
> Are there recommended workarounds for drivers that
> require precise clock rates?
> Could SCMI protocol be extended to support parent-aware
> rate negotiation and rate propagation?
>
A quick reply, there have been other reports/requests around this and an
internal discussion thread has been started with ATG, and this report of
yours too is being considered.
Once we have something concrete to discuss we'll get back in touch.
Thanks,
Cristian
next prev parent reply other threads:[~2025-10-31 19:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-30 2:36 SCMI Clock Protocol: clk_round_rate() mismatch with actual get_rate() results Peng Fan
2025-10-31 19:23 ` Cristian Marussi [this message]
2025-11-03 0:09 ` Peng Fan
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=aQUMrmJ4tX-i7pIS@pluto \
--to=cristian.marussi@arm.com \
--cc=arm-scmi@vger.kernel.org \
--cc=d-gole@ti.com \
--cc=peng.fan@nxp.com \
--cc=ranjani.vaidyanathan@nxp.com \
--cc=sebin.francis@ti.com \
--cc=souvik.chakravarty@arm.com \
--cc=sudeep.holla@arm.com \
--cc=vincent.guittot@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.