* [PATCH v15 1/2] clk: scmi: fix SSC spread conversion
[not found] <20261104103620.4054694-1-dario.binacchi@amarulasolutions.com>
@ 2026-11-04 10:36 ` Dario Binacchi
2026-11-10 14:21 ` Cristian Marussi
0 siblings, 1 reply; 2+ messages in thread
From: Dario Binacchi @ 2026-11-04 10:36 UTC (permalink / raw)
To: Sudeep Holla, Cristian Marussi
Cc: imx, Peng Fan, linux-amarula, arm-scmi, michael, Dario Binacchi,
stable, Sashiko, Brian Masney, Jerome Brunet, Sebin Francis,
Stephen Boyd, linux-clk, linux-kernel
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, while the i.MX
SCMI OEM extension expects a value in tenths of a percent, as pointed
out by Peng Fan.
The conversion divides spread_bp by 10000 instead of 10, as reported by
Sashiko, so any valid configuration is truncated to 0 and the hardware
is silently programmed with no spread at all.
Divide by 10 and fix the comment accordingly.
Fixes: 77369b1e6a37 ("clk: scmi: Add i.MX95 OEM extension support for SCMI clock driver")
Cc: stable@vger.kernel.org
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/r/20260901155657.6A5981F00A3A@smtp.kernel.org
Reported-by: Peng Fan <peng.fan@nxp.com>
Closes: https://lore.kernel.org/r/ZR6PR04MB375776A27E98F140534E8F7FE488B62@ZR6PR04MB375776.eurprd04.prod.outlook.com
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
Changes in v15:
- Add Cc to stable.
Changes in v14:
- Add Reviewed-by of Peng Fan
Changes in v13:
- Divide spread_bp by 10 instead of 100 as requested by Peng Fan.
- Rename the patch title and reword the description accordingly.
- Add the Reported-by/Closes tags for Sashiko and Peng Fan.
drivers/clk/clk-scmi-oem.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/clk-scmi-oem.c b/drivers/clk/clk-scmi-oem.c
index be11d359b4ec..c1ebbdc6bbc5 100644
--- a/drivers/clk/clk-scmi-oem.c
+++ b/drivers/clk/clk-scmi-oem.c
@@ -39,12 +39,12 @@ scmi_clk_imx_set_spread_spectrum(struct clk_hw *hw,
u32 val;
/*
- * extConfigValue[7:0] - spread percentage (%)
+ * extConfigValue[7:0] - spread percentage in tenths of a percent
* extConfigValue[23:8] - Modulation Frequency
* 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 / 10);
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v15 1/2] clk: scmi: fix SSC spread conversion
2026-11-04 10:36 ` [PATCH v15 1/2] clk: scmi: fix SSC spread conversion Dario Binacchi
@ 2026-11-10 14:21 ` Cristian Marussi
0 siblings, 0 replies; 2+ messages in thread
From: Cristian Marussi @ 2026-11-10 14:21 UTC (permalink / raw)
To: Dario Binacchi
Cc: Sudeep Holla, Cristian Marussi, imx, Peng Fan, linux-amarula,
arm-scmi, michael, stable, Sashiko, Brian Masney, Jerome Brunet,
Sebin Francis, Stephen Boyd, linux-clk, linux-kernel
On Wed, Nov 04, 2026 at 11:36:02AM +0100, Dario Binacchi wrote:
> 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, while the i.MX
> SCMI OEM extension expects a value in tenths of a percent, as pointed
> out by Peng Fan.
>
> The conversion divides spread_bp by 10000 instead of 10, as reported by
> Sashiko, so any valid configuration is truncated to 0 and the hardware
> is silently programmed with no spread at all.
>
> Divide by 10 and fix the comment accordingly.
>
LGTM.
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Thanks,
Cristian
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-10 14:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20261104103620.4054694-1-dario.binacchi@amarulasolutions.com>
2026-11-04 10:36 ` [PATCH v15 1/2] clk: scmi: fix SSC spread conversion Dario Binacchi
2026-11-10 14:21 ` Cristian Marussi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox