| Message ID | 20261104085036.4012238-21-dario.binacchi@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Delivered-To: michael@amarulasolutions.com
Received: by 2002:a05:7301:6783:b0:36a:3487:1c26 with SMTP id qo3csp69296dyb;
Wed, 4 Nov 2026 00:51:55 -0800 (PST)
X-Forwarded-Encrypted: i=2;
AKwUvBy7srbJbEzBSH44RxHE9sjLb8j9pMtLgrKaWSwzCQv8BguRMmP52CHLwIo3PQ8ZKNZ50i6IJIAF@amarulasolutions.com
X-Received: by 2002:a05:600c:6099:b0:4a1:811c:8078 with SMTP id
5b1f17b1804b1-4ac185bc1d2mr329543105e9.26.1793782315442;
Wed, 04 Nov 2026 00:51:55 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1793782315; cv=none;
d=google.com; s=arc-20260327;
b=qPJ1wa3nnzTNU5Wj6MfSKW2IeZTNsXGoHwSHXWNAkh1TW5/aQQpL30i0OzYuDtV9KP
PWtwgm8f+M/yxcAudqOgqSr70FWTKio4h8uEWsvLKC2XtMGcdaxBTGy19F2jY+SFk6mo
jYJDyvAheW+62xGNvebgP+XXyDG+pvPPJ+SrozJgrldmLEW39uJa54IGAIMd0P7kb85/
Qv0gOR4eZj4G1K/95HckrL25YIyNHUsfqklXgjkmhV51/3FkrWakE5Lg1jljmJL94GN4
YfW9BK0ZD8IBA/lOV7Np4QTiwz9dnOhVb1c/0FFbzyRFFZpD+59KGVGXIlMcFYdOu3DP
cspg==
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=pjP8+6Rpk25xx41kblJdcnBzlRb2gprTWz3voisThN8=;
fh=67MvZ6F6XIB/Cjuio7Oi+kr/4lVLKnmFcy7toi2vn2g=;
b=Fbjr13AH6UgFUOIS5x/QdTIk30kbxRBArinZ1rFNk/BCNxRG3dOp+4M1CN9pMJkbbz
03W0zvigogyfnddYwI9qbkAh1EOeF4fqn9GKDH/gHo4Ewu5hiwGXuqvtRFrVDifBf7/l
Zqz3+R4ashqYudAWV6riqsWHXS3uRN7sUDrRB0ev39B2j/KETKGUip1+Pd5lGiqpgcM+
Tt6YELSF8nb1gqsw3Ql2LH8AZFrLk+BnFMRRzMqfUSpK4QkSzCDCUMalv/Qkqz273pqA
TXGUzCryR1fmjYgu6Y6Rm/FuM/CdMuBP7Nig+Ev3xtLKi/ejztzLhg1Nh5vHvYNX+7Gl
n7kg==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@amarulasolutions.com header.s=google
header.b=Q6iTahq0;
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
Return-Path: <dario.binacchi@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-4b437e27199sor2343585e9.0.2026.11.04.00.51.55
for <michael@amarulasolutions.com>
(Google Transport Security);
Wed, 04 Nov 2026 00:51:55 -0800 (PST)
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;
Authentication-Results: mx.google.com;
dkim=pass header.i=@amarulasolutions.com header.s=google
header.b=Q6iTahq0;
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=1793782315; x=1794387115;
darn=amarulasolutions.com;
h=content-transfer-encoding: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=pjP8+6Rpk25xx41kblJdcnBzlRb2gprTWz3voisThN8=;
b=Q6iTahq0C3xKw6kSusytcy1il65eAiUY0UotHBZ0bnmdXQ+pusyiACmz3DEAxexbiA
8eQwcBxHb0Q4VT4ahBFK+bmNHsVMsmK0iXi9SH+dRm9Vx+bGGFt76Mnh6WgfY/dyvr7c
xIylDvD/t1vO45VAejzig7/Qbdwo1Hpk5xvHU=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1793782315; x=1794387115;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
:to:cc:subject:date:message-id:reply-to:content-type;
bh=pjP8+6Rpk25xx41kblJdcnBzlRb2gprTWz3voisThN8=;
b=tAVUZ88rfm0HsxLqk7c3U3RoqO9eWmwb3iN+TAreYV+moD454BMFg4stmqKJMn/dDd
oJMp9qEV0yIFxYYAYBeheUU03S6b1MfFD7mAMoA0WTPN4FTb5/DUmtKNFgjVJm4AGet2
nBlYI6exn4LtiHTpj8Vx+YU571YoqlkEC8bfhZW6uaYC35nohuBJuci8Mo3ZZF2BA8mV
3MakRUEatKklZoFo2gk9dcaqJkrC799W6AnvdU1zz5Oubi5n1VZRjKacHl2dICfChLI6
Zy/S5JDJOZXlpizXrcgtEj4KxCrn2m8D+WRsrdTVF/hysGOzYrz7BfDZiCZKfWqudNO9
+Utg==
X-Forwarded-Encrypted: i=1;
AKwUvBwTzZWDyTEjKqZuk6R+WYfdPftyScpb6onvinHTdf7m73pMaD5RMTQJsy0LOYp8IDHR0jVpO/f0@amarulasolutions.com
X-Gm-Message-State: APuU4Z9S+vmnTEmOD8qBk4h1aq/7w+ITTOi/ofJGy+3wv+GmbrsKWZQh
wNAw00/khdTIv0RvRsaVkSIpUpO/8Y5bpSC34YguUkBSAYVY0KRDQizR14lFcISthub0mn59U0Z
4t2FWvXw=
X-Gm-Gg: AYBFou1Jvr1h/BM1RkoCXT+kVorgQnY1AEcQfA/fxRs8yWOHNeViuQviS12zDHjBtwe
jGvOmx9GZhTZCztHTN5P1TGR0LlNxx+SXQwwJFbLNZ6Iy0U9ctgzCXA9W0rRp8dNZLUVbZ1gQpt
Mh4SUD/GqE5L8lp2hxxXZqk0fVk7ugXgakJOJCTZjmFm64dWIFCu22+hL/TllDzIL6vRrErn3nL
uLixr1oIPk/Cf5i+Y5xxVUzj67dPT7tW5AOOtUlbrjdzaJKt9iughIRSShODf5RiQlNwezjcUXn
KG8Lam10Vrxq6kAagnJD5jRIWfEtMLHnLOGpRQ7OZhgahu2GZWT6ErqRjizEJCMSupScRJuDs73
jUcorg/f4N/OoOz8KRSspNEJSIve9RXr2jPENGuLX19/kSQFZiNtV/GrpCJ0nSbOuxpEcK0t9AN
tz7E5jgMmm7s+nnmDWuiRBafFTJJxmV7PPCIzEFGTJQ2x57xNbuIlon5l/aR1zuGDFqIZPoH8wo
bVkoA2hlrYbOoc6mFeiCZQal2d/M3aYz+tKatjgbFKmyfHDyziB0CQtfVEVRxKuuCqg35JDRVfO
swZAqoGZJGttZaTxOcJt8C3PeNyD6RO3CebDSimSK/XtMSDKCuq1Bo8jTWBtbGgyUWw9s9WDSCf
yMQT6nXkfmA/YsI4b2ZK9JxqlfV4=
X-Received: by 2002:a05:600c:3d05:b0:4a1:faa1:3813 with SMTP id
5b1f17b1804b1-4ac187a6960mr354511905e9.27.1793782314857;
Wed, 04 Nov 2026 00:51:54 -0800 (PST)
Return-Path: <dario.binacchi@amarulasolutions.com>
Received: from dario-ThinkPad-P14s-Gen-5.. ([109.54.139.206])
by smtp.gmail.com with ESMTPSA id
5b1f17b1804b1-4b413312a4fsm20555915e9.1.2026.11.04.00.51.52
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 04 Nov 2026 00:51:54 -0800 (PST)
From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
To: Patrice Chotard <patrice.chotard@foss.st.com>,
Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: linux-amarula@amarulasolutions.com,
michael@amarulasolutions.com,
Dario Binacchi <dario.binacchi@amarulasolutions.com>,
Gabriel Fernandez <gabriel.fernandez@foss.st.com>,
Lukasz Majewski <lukma@nabladev.com>,
Tom Rini <trini@konsulko.com>,
u-boot@lists.u-boot-project.org,
uboot-stm32@st-md-mailman.stormreply.com
Subject: [PATCH 20/33] clk: stm32: propagate rate changes to the parent clock
Date: Wed, 4 Nov 2026 09:49:53 +0100
Message-ID: <20261104085036.4012238-21-dario.binacchi@amarulasolutions.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20261104085036.4012238-1-dario.binacchi@amarulasolutions.com>
References: <20261104085036.4012238-1-dario.binacchi@amarulasolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
|
| Series |
Add Engicam MicroGEA-STM32MP257D-RMM board support
|
|
Commit Message
Dario Binacchi
Nov. 4, 2026, 8:49 a.m. UTC
Since commit 901e0d95df3b ("clk: stm32: fix clock counter"), the
set_rate operation of the clock is called directly, so the
CLK_SET_RATE_PARENT flag is ignored and the rate of a clock relying on
its parent, like the STM32MP25 LTDC kernel clock, can't be set anymore:
stm32_display display-controller@48010000: fail to set pixel clock 27000000 hz, ret=-38
Use clk_set_rate() again, which walks up the parents having
CLK_SET_RATE_PARENT set. Unlike clk_enable(), it doesn't update any
counter, so the issue fixed by that commit is not reintroduced.
Fixes: 901e0d95df3b ("clk: stm32: fix clock counter")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
drivers/clk/stm32/clk-stm32-core.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
--
2.43.0
Comments
On 11/4/26 09:49, Dario Binacchi wrote: > Since commit 901e0d95df3b ("clk: stm32: fix clock counter"), the > set_rate operation of the clock is called directly, so the > CLK_SET_RATE_PARENT flag is ignored and the rate of a clock relying on > its parent, like the STM32MP25 LTDC kernel clock, can't be set anymore: > > stm32_display display-controller@48010000: fail to set pixel clock 27000000 hz, ret=-38 > > Use clk_set_rate() again, which walks up the parents having > CLK_SET_RATE_PARENT set. Unlike clk_enable(), it doesn't update any > counter, so the issue fixed by that commit is not reintroduced. > > Fixes: 901e0d95df3b ("clk: stm32: fix clock counter") > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > --- > > drivers/clk/stm32/clk-stm32-core.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git a/drivers/clk/stm32/clk-stm32-core.c b/drivers/clk/stm32/clk-stm32-core.c > index cd6bdee5412f..f9a0ba2f5748 100644 > --- a/drivers/clk/stm32/clk-stm32-core.c > +++ b/drivers/clk/stm32/clk-stm32-core.c > @@ -168,17 +168,12 @@ static ulong stm32_clk_get_rate(struct clk *clk) > > static ulong stm32_clk_set_rate(struct clk *clk, unsigned long clk_rate) > { > - const struct clk_ops *ops; > struct clk *c = NULL; > > if (!clk->id || clk_get_by_id(clk->id, &c)) > return -ENOENT; > > - ops = clk_dev_ops(c->dev); > - if (!ops->set_rate) > - return -ENOSYS; > - > - return ops->set_rate(c, clk_rate); > + return clk_set_rate(c, clk_rate); > } > > const struct clk_ops stm32_clk_ops = { Hi Dario This patch is coming from ST downstream tree : https://github.com/STMicroelectronics/u-boot/commit/804e2d5f7b376703a465e1a9a81b5d7db7adfd01 Please, keep original Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com> Thanks Patrice
Hi Patrice, On Fri, Nov 6, 2026 at 5:46 PM Patrice CHOTARD <patrice.chotard@foss.st.com> wrote: > > > > On 11/4/26 09:49, Dario Binacchi wrote: > > Since commit 901e0d95df3b ("clk: stm32: fix clock counter"), the > > set_rate operation of the clock is called directly, so the > > CLK_SET_RATE_PARENT flag is ignored and the rate of a clock relying on > > its parent, like the STM32MP25 LTDC kernel clock, can't be set anymore: > > > > stm32_display display-controller@48010000: fail to set pixel clock 27000000 hz, ret=-38 > > > > Use clk_set_rate() again, which walks up the parents having > > CLK_SET_RATE_PARENT set. Unlike clk_enable(), it doesn't update any > > counter, so the issue fixed by that commit is not reintroduced. > > > > Fixes: 901e0d95df3b ("clk: stm32: fix clock counter") > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > --- > > > > drivers/clk/stm32/clk-stm32-core.c | 7 +------ > > 1 file changed, 1 insertion(+), 6 deletions(-) > > > > diff --git a/drivers/clk/stm32/clk-stm32-core.c b/drivers/clk/stm32/clk-stm32-core.c > > index cd6bdee5412f..f9a0ba2f5748 100644 > > --- a/drivers/clk/stm32/clk-stm32-core.c > > +++ b/drivers/clk/stm32/clk-stm32-core.c > > @@ -168,17 +168,12 @@ static ulong stm32_clk_get_rate(struct clk *clk) > > > > static ulong stm32_clk_set_rate(struct clk *clk, unsigned long clk_rate) > > { > > - const struct clk_ops *ops; > > struct clk *c = NULL; > > > > if (!clk->id || clk_get_by_id(clk->id, &c)) > > return -ENOENT; > > > > - ops = clk_dev_ops(c->dev); > > - if (!ops->set_rate) > > - return -ENOSYS; > > - > > - return ops->set_rate(c, clk_rate); > > + return clk_set_rate(c, clk_rate); > > } > > > > const struct clk_ops stm32_clk_ops = { > > Hi Dario > > This patch is coming from ST downstream tree : > https://github.com/STMicroelectronics/u-boot/commit/804e2d5f7b376703a465e1a9a81b5d7db7adfd01 > > Please, keep original Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com> Thanks for pointing it out. In v2 I will send Gabriel's patch, keeping him as the author with his Signed-off-by, and adding the Fixes tag. Thanks and regards, Dario > > Thanks > Patrice -- Dario Binacchi Senior Embedded Software Engineer M. +39 328 0625246 dario.binacchi@amarulasolutions.com ――――――――――――――― Amarula Solutions SRL Via Felice Cavallotti 25D, 41012 Carpi, MO, IT info@amarulasolutions.com www.amarulasolutions.com
diff --git a/drivers/clk/stm32/clk-stm32-core.c b/drivers/clk/stm32/clk-stm32-core.c index cd6bdee5412f..f9a0ba2f5748 100644 --- a/drivers/clk/stm32/clk-stm32-core.c +++ b/drivers/clk/stm32/clk-stm32-core.c @@ -168,17 +168,12 @@ static ulong stm32_clk_get_rate(struct clk *clk) static ulong stm32_clk_set_rate(struct clk *clk, unsigned long clk_rate) { - const struct clk_ops *ops; struct clk *c = NULL; if (!clk->id || clk_get_by_id(clk->id, &c)) return -ENOENT; - ops = clk_dev_ops(c->dev); - if (!ops->set_rate) - return -ENOSYS; - - return ops->set_rate(c, clk_rate); + return clk_set_rate(c, clk_rate); } const struct clk_ops stm32_clk_ops = {