From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
To: linux-kernel@vger.kernel.org
Cc: linux-amarula@amarulasolutions.com,
Dario Binacchi <dario.binacchi@amarulasolutions.com>,
Brian Masney <bmasney+clk@redhat.com>,
Cristian Marussi <cristian.marussi@arm.com>,
Jerome Brunet <jbrunet+clk@baylibre.com>,
Peng Fan <peng.fan@nxp.com>, Sebin Francis <sebin.francis@ti.com>,
Stephen Boyd <sboyd@kernel.org>,
linux-clk@vger.kernel.org
Subject: [PATCH v12 1/3] clk: scmi: fix SSC permyriad conversion
Date: Wed, 2 Sep 2026 12:07:33 +0200 [thread overview]
Message-ID: <20260902101515.167819-2-dario.binacchi@amarulasolutions.com> (raw)
In-Reply-To: <20260902101515.167819-1-dario.binacchi@amarulasolutions.com>
The spread_bp field of struct clk_spread_spectrum holds the modulation
depth in permyriad (1/100 of a percent), as documented in
clk-provider.h and in the assigned-clock-sscs binding. The i.MX SCMI
OEM extension expects an integer percentage in extConfigValue[7:0].
The conversion divides spread_bp by 10000 instead of 100, so any valid
configuration is truncated to 0 (or to 1 for a 100% spread) and the
hardware is silently programmed with no spread at all.
Divide by 100 to correctly convert permyriad to percent.
Fixes: 77369b1e6a37 ("clk: scmi: Add i.MX95 OEM extension support for SCMI clock driver")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
(no changes since v1)
drivers/clk/clk-scmi-oem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/clk-scmi-oem.c b/drivers/clk/clk-scmi-oem.c
index be11d359b4ec..3e56e91ae68c 100644
--- a/drivers/clk/clk-scmi-oem.c
+++ b/drivers/clk/clk-scmi-oem.c
@@ -44,7 +44,7 @@ scmi_clk_imx_set_spread_spectrum(struct clk_hw *hw,
* extConfigValue[24] - Enable/Disable
* extConfigValue[31:25] - Reserved
*/
- val = FIELD_PREP(SCMI_CLOCK_IMX_SS_PERCENTAGE_MASK, ss_conf->spread_bp / 10000);
+ val = FIELD_PREP(SCMI_CLOCK_IMX_SS_PERCENTAGE_MASK, ss_conf->spread_bp / 100);
val |= FIELD_PREP(SCMI_CLOCK_IMX_SS_MOD_FREQ_MASK, ss_conf->modfreq_hz);
if (ss_conf->method != CLK_SPREAD_NO)
val |= SCMI_CLOCK_IMX_SS_ENABLE_MASK;
--
2.43.0
next prev parent reply other threads:[~2026-09-02 10:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 10:07 [PATCH v12 0/3] Support spread spectrum clocking for i.MX8M PLLs Dario Binacchi
2026-09-02 10:07 ` Dario Binacchi [this message]
2026-09-02 10:07 ` [PATCH v12 2/3] clk: validate spread spectrum configuration Dario Binacchi
2026-09-02 10:07 ` [PATCH v12 3/3] clk: imx: pll14xx: support spread spectrum clock generation Dario Binacchi
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=20260902101515.167819-2-dario.binacchi@amarulasolutions.com \
--to=dario.binacchi@amarulasolutions.com \
--cc=bmasney+clk@redhat.com \
--cc=cristian.marussi@arm.com \
--cc=jbrunet+clk@baylibre.com \
--cc=linux-amarula@amarulasolutions.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peng.fan@nxp.com \
--cc=sboyd@kernel.org \
--cc=sebin.francis@ti.com \
/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