| Message ID | 20260903153836.373267-2-dario.binacchi@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path:
<linux-amarula+bncBCQ4XFG47UFRBD5J43KAMGQEXEGEPQA@amarulasolutions.com>
X-Original-To: linux-amarula@patchwork.amarulasolutions.com
Delivered-To: linux-amarula@patchwork.amarulasolutions.com
Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com
[209.85.128.70])
by ganimede.amarulasolutions.com (Postfix) with ESMTPS id AC8D93F0E6
for <linux-amarula@patchwork.amarulasolutions.com>;
Thu, 3 Sep 2026 17:38:56 +0200 (CEST)
Received: by mail-wm1-f70.google.com with SMTP id
5b1f17b1804b1-499b99a8a10sf8813495e9.0
for <linux-amarula@patchwork.amarulasolutions.com>;
Thu, 03 Sep 2026 08:38:56 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1788449936; cv=pass;
d=google.com; s=arc-20260327;
b=ig3bU39OC8uimyVTgNJKcms2bZm5Lm2WYRsSCiLrAVtWDtwGWjMi+Uw60OxX7eL8f6
pL6/senZfgfVzcqnYjM8yn7KT1jKTsAEU9EmK5IGjNhbSAbZGiNuTKwkAqX7FzLOymVX
rOWJPLEPNE1MGVfY5xTKI9uBKQpehitIH/ByncxkV8Lh4e6c5py4MJ4sGVau6O8PLxQU
Z1ttPYhxP6YTQndeSfKEkTNXYQXdXiz3THYVOa9h78osEGxW+QJ36UrXAxdz4N8tIRi1
iUnXJOkdoj7KBMsSdtIUSTkKZqFNhzi9NZKprBSCXNSIO7MOWJqjvYViZ7hlf3qPdsLB
ZAbg==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20260327;
h=list-unsubscribe:list-archive:list-help:list-post:list-id
:mailing-list:precedence:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:dkim-signature;
bh=n7nM6brmD4YUksdHJS2gnMAxelHWMJCOzJoMjT3JN5g=;
fh=hVn3O1SZFzGR3ByOf2Udr/9evj8eJ9KDsqFo+UQT35g=;
b=rGsLIpsCCJsQ3oQ24PO0qFUawaA2uMxasW1pKZ5QTprH4VC90eJnu9S2/NaWzEU5Gp
s5E8E5VlOreWqCcfjIfjJVHiywL0+RDqWjtuA5yAZrR86081PeIivBvnSFc2GWYooZzl
InN0qectIOl/UDKtoIWe3YWEwsWjGi8uB8G+jyp3NeqJuJBTZn2oRQB2J8pQjwjb9Su2
Xrg3WsZ2GzTx3MjuvZ6YNSyx9vdaMKMJgsZbrkd1FYg4QD9AoXw0z4dy1Nh+L63PaWJU
GPMkkmYALOABRtzsbbwgYKCs892nkeZwRfL9iODuDy/roqWHT7bIazJu4YQvDstJ+IMk
v1oQ==;
darn=patchwork.amarulasolutions.com
ARC-Authentication-Results: i=2; mx.google.com;
dkim=pass header.i=@amarulasolutions.com header.s=google
header.b=QTcpBA0Y;
spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com
designates 209.85.220.41 as permitted sender)
smtp.mailfrom=dario.binacchi@amarulasolutions.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com;
dara=neutral header.i=@amarulasolutions.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=amarulasolutions.com; s=google; t=1788449936; x=1789054736;
darn=patchwork.amarulasolutions.com;
h=list-unsubscribe:list-archive:list-help:list-post:list-id
:mailing-list:precedence:content-type
:x-original-authentication-results:x-original-sender:mime-version
:references:in-reply-to:message-id:date:subject:cc:to:from:from:to
:cc:subject:date:message-id:reply-to:content-type;
bh=n7nM6brmD4YUksdHJS2gnMAxelHWMJCOzJoMjT3JN5g=;
b=HaX05vYkmpChpS+7Lh3u/TF63Smk+r5oA5YgF4I5ZJDKXL86Jkd1mTpqUBP/qDPWd/
RO2WoUoN/Oh6yvrYn0gUIMSUq6wULkGI4YGJJm6Yo5hvw/iJZGbQMCLI8pdzZDuC5IPT
GZpy7E/6sOD1xJEm8R/a+rScV40j2S72LGreI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20251104; t=1788449936; x=1789054736;
h=list-unsubscribe:list-archive:list-help:list-post
:x-spam-checked-in-group:list-id:mailing-list:precedence
:content-type:x-original-authentication-results:x-original-sender
:mime-version:references:in-reply-to:message-id:date:subject:cc:to
:from:x-gm-gg:x-beenthere:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=n7nM6brmD4YUksdHJS2gnMAxelHWMJCOzJoMjT3JN5g=;
b=DcHUauT0fy1kdjGFf7CpLQtnw2+dqeE178vAMpF90dCwd7z37EbIFDesuEK1Ct0XGr
ukcr56eQ4p/26QB3U2WYzzNdWJcN8hQr1c1cqR0WmIUjoeXuJJl5Drj3F7VwZr+iVHlm
1Wr+QDsRPyk3szGGrFeatVq2IlHQJQUYpUSGkPMatSrrupUAPe+PK4jJcSBTvqHa+ssT
Fm6y4y4J3Q7U+i7exg6ITQ/mhUBwt703hbJQ/7ZHT63dANK52W6ESsrK5dSeOaT2KOpR
kJt0QGi1WBzLutqdrGMrcCfHFu0WjOAJHYfio8Wot9ZnPvyOFqo/BLmJoO+PrdMJiCKb
VnSA==
X-Forwarded-Encrypted: i=2;
AKwUvBze7MCanZybakzaLoPZ7EwcolD5edqEJJPsuXpHAWBMFB9lRJjq+pBm/aS1y0821gxKcb6tphlCwTY2QN8d@patchwork.amarulasolutions.com
X-Gm-Message-State: AFuF++n9TpQGMxItzKePNyPY4bXh6P+DDTwQWiOc94gqsgQ1NdbxXaxb
mKQFF26NCaeC5xG3B4hniYTUn9oBV5OPZdS/NoWcrroT7KLZEdHfPVQHEF/cN77iH7gnkBueFev
EEQ==
X-Received: by 2002:a05:600c:46c6:b0:49c:799a:177b with SMTP id
5b1f17b1804b1-49cf1576df1mr45685995e9.2.1788449936146;
Thu, 03 Sep 2026 08:38:56 -0700 (PDT)
X-BeenThere: linux-amarula@amarulasolutions.com;
h="ATskLdcmMO7yo2VQhvUH71YvRxMfecdaqSzFH4yLKaatMWBp5g=="
Received: by 2002:a05:600d:a:b0:499:d480:ced0 with SMTP id
5b1f17b1804b1-49cee32905als3752045e9.0.-pod-prod-00-eu-canary;
Thu, 03 Sep 2026 08:38:54 -0700 (PDT)
X-Forwarded-Encrypted: i=2;
AKwUvByX1H0ycJ2NqLsuXV94EQpeVkwGg0+obQP/TL8QYTmPWckeziWrDaWKtG35BKPcAh2jvGx2NhHsW0Bb5m8u@amarulasolutions.com
X-Received: by 2002:a05:600c:1388:b0:49c:eded:44e with SMTP id
5b1f17b1804b1-49cf158e77fmr45406705e9.7.1788449934383;
Thu, 03 Sep 2026 08:38:54 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1788449934; cv=none;
d=google.com; s=arc-20260327;
b=bMdLI3bJsLywfevxmRNOtxl+WTRY9esMLfWYjUaGIpu3zNdjQ2EEGMZtZnRe2V4LFh
2O7w+pJ8AE+eB+C7pSIq0fyr5eHxbc0E6yoc0uJ860mZ0dQ0LYLXloUGyqLO4MIgyyxH
MsT1PPOmQRt+mu3cJsPTC651DSiZapeEG2ywi87N4RjycB7E/G/xsONONb3LOwW+CLIH
0n+MJCscBemDZygcmYMdKwkGVaG40ebIavUArSQNMQ2c5laoyXbtjARoPDn4r4/Zvscf
7F+fF5PlLwmbaiJaRMWnG+JFCGTnb9ZA70zIpyluw3g/C8c6oBlAghht0r3v5Vw8Np7A
adTw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20260327;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:dkim-signature;
bh=0o+HCmOQx9XAtsX24zUFSwjZJzmYz+uo9CE80R3VvZQ=;
fh=qD75TUcM+OiA69oMg18yG9zIgCmpDBw/od9eEWRT4E0=;
b=JUbIDCFAfJNyBOd1/iMlUolbdQMYPoIacS0wynTGB60amsw9LSUF3dVhvNchvu2lEJ
LAM3b2UNoqxkDgpw7SkRLLFtPzfRlMsvuMM5PMY15xVO1QfpkT/3sjOaYG5zl20iPK+g
0lVIMKUDuQXABjqhYc6aU895EeRNmcor9WZAoXuxaCKGlk+be6gE/5A06T0nisMAQcbv
bTor68fRuRrY31yT7tY6meoXZ3OS9DCVlmT3NHVGsSdHxUw8mYMwkvBV44fcFTVUTI1o
ysr0tdsRHF5Uzi29/TRgjNNjQKE64wcmid9bK77WhordhCP9WldsD29xigRYZsWMUCYO
gq8A==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@amarulasolutions.com header.s=google
header.b=QTcpBA0Y;
spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com
designates 209.85.220.41 as permitted sender)
smtp.mailfrom=dario.binacchi@amarulasolutions.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com;
dara=neutral header.i=@amarulasolutions.com
Received: from mail-sor-f41.google.com (mail-sor-f41.google.com.
[209.85.220.41])
by mx.google.com with SMTPS id
5b1f17b1804b1-49cee6051bcsor3263235e9.10.2026.09.03.08.38.54
for <linux-amarula@amarulasolutions.com>
(Google Transport Security);
Thu, 03 Sep 2026 08:38:54 -0700 (PDT)
Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com
designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Forwarded-Encrypted: i=1;
AKwUvBxObVIjyh8f0KxXKmAIDywoh8BgilBBe90pTGFPCqQYH6PZdtZ3tv/h8LOOXSgEtfxC/U+5pt7T7PH/8cnA@amarulasolutions.com
X-Gm-Gg: AYBFou2k4pervB+yQIhpEvlHTALoKpMlfExgBp5LwXC9bKJn/lVhcW2AKiSJJOm1yQ4
CuWpNbrXtcDbeoiSG1ERgRP4UV8slGNfbNX0oVDtmdHg/CLdxG1K6HT/uXzu3Fbm7QUvCsKtlK8
9SdDK0XWG84xasWkamROwfoG/6vbQWNFGOsN+EFYwiamG9pah1PgiznqiIP7/ZY9oMcRatafwMm
h7y64TxqeUyDCN9mgGiDGgQ4td/xO/1RW20lgu2RxMvEnfLiO5xpeVaR4Ib7oOEgjECVZMpEFgj
oMSoAsgjho4jYdBOP+XAdrZALMSTvNAPvo4VwJZ5TJKIwU3FZRUeSsQsvs1fGucyS5lWSWxQwgJ
pcC7fXfs74hfe2218zXboTRf0ife4djdWNusT4t57h6YmykMMVo/+tKyUJOrMtcbPsoecljYATT
pwN4BBaRrmBfMHfjDyNTMgnqYvURoO6+/+F1uCLZYMV73h12biPyibaRjnAZF3mywOqC+NondKR
9f1T+vTjI8eeTccgr95Tt5N3eBLWjV9uMTxn6eQJWCwaeiLRDJUtxGYAv0DA6ZxJBRWSbqIufCH
KLMmp0c/JQ6OmYTCpM/WWP0B+7/6Ne27Su9bmjLkQ2CM6hc/GCfnWSNC3re7QhueP+o=
X-Received: by 2002:a05:600c:46c6:b0:49c:799a:177b with SMTP id
5b1f17b1804b1-49cf1576df1mr45683825e9.2.1788449933923;
Thu, 03 Sep 2026 08:38:53 -0700 (PDT)
Received: from dario-ThinkPad-P14s-Gen-5.amarulasolutions.com
(host-95-245-93-90.retail.telecomitalia.it. [95.245.93.90])
by smtp.gmail.com with ESMTPSA id
ffacd0b85a97d-48448e72df2sm15366301f8f.1.2026.09.03.08.38.51
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 03 Sep 2026 08:38:53 -0700 (PDT)
From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
To: linux-kernel@vger.kernel.org
Cc: michael@amarulasolutions.com,
linux-amarula@amarulasolutions.com,
Dario Binacchi <dario.binacchi@amarulasolutions.com>,
Sashiko <sashiko-bot@kernel.org>,
Peng Fan <peng.fan@nxp.com>,
Brian Masney <bmasney+clk@redhat.com>,
Cristian Marussi <cristian.marussi@arm.com>,
Jerome Brunet <jbrunet+clk@baylibre.com>,
Sebin Francis <sebin.francis@ti.com>,
Stephen Boyd <sboyd@kernel.org>,
linux-clk@vger.kernel.org
Subject: [PATCH v13 1/4] clk: scmi: fix SSC spread conversion
Date: Thu, 3 Sep 2026 17:32:13 +0200
Message-ID: <20260903153836.373267-2-dario.binacchi@amarulasolutions.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260903153836.373267-1-dario.binacchi@amarulasolutions.com>
References: <20260903153836.373267-1-dario.binacchi@amarulasolutions.com>
MIME-Version: 1.0
X-Original-Sender: dario.binacchi@amarulasolutions.com
X-Original-Authentication-Results: mx.google.com; dkim=pass
header.i=@amarulasolutions.com header.s=google header.b=QTcpBA0Y;
spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com
designates 209.85.220.41 as permitted sender)
smtp.mailfrom=dario.binacchi@amarulasolutions.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com;
dara=neutral header.i=@amarulasolutions.com
Content-Type: text/plain; charset="UTF-8"
Precedence: list
Mailing-list: list linux-amarula@amarulasolutions.com;
contact linux-amarula+owners@amarulasolutions.com
List-ID: <linux-amarula.amarulasolutions.com>
X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com
X-Google-Group-Id: 476853432473
List-Post:
<https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>,
<mailto:linux-amarula@amarulasolutions.com>
List-Help:
<https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>,
<mailto:linux-amarula+help@amarulasolutions.com>
List-Archive:
<https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/>
List-Unsubscribe:
<mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>,
<https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe>
|
| Series |
Support spread spectrum clocking for i.MX8M PLLs
|
|
Commit Message
Dario Binacchi
Sept. 3, 2026, 3:32 p.m. UTC
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")
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
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
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(-)
Comments
On Thu, Sep 03, 2026 at 05:32:13PM +0200, 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. > >Fixes: 77369b1e6a37 ("clk: scmi: Add i.MX95 OEM extension support for SCMI clock driver") >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 >Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > Reviewed-by: Peng Fan <peng.fan@nxp.com> To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
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;