From: "Shuwei Wu" <shuwei.wu@mailbox.org>
To: "Viresh Kumar" <viresh.kumar@linaro.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Paul Walmsley" <pjw@kernel.org>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Alexandre Ghiti" <alex@ghiti.fr>, "Yixun Lan" <dlan@kernel.org>,
<linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-riscv@lists.infradead.org>, <spacemit@lists.linux.dev>,
<devicetree@vger.kernel.org>
Subject: Re: [PATCH v3 1/2] cpufreq: spacemit: Add K1 cpufreq driver
Date: Mon, 15 Jun 2026 14:12:06 +0800 [thread overview]
Message-ID: <DJ9EFPG561VZ.1WGRYYHJ2W9J9@mailbox.org> (raw)
In-Reply-To: <bd4s2icqgusnuujvrpoag4cniy3g2e4bumecqxt5yffl77aqpq@kxg4dj4c2wk3>
Hi Viresh,
Thanks for your reply.
On Mon Jun 15, 2026 at 1:24 PM CST, Viresh Kumar wrote:
> On 12-06-26, 17:51, Shuwei Wu wrote:
>> K1 has two CPU cluster clocks but one shared CPU voltage rail. Use one
>> cpufreq policy for all CPUs, let the OPP core handle the shared regulator
>> and the cluster0 clock, and update the cluster1 clock explicitly.
>
> If the clusters can do DVFS individually (as they have separate clocks), this
> should be represented as two separate policies. Isn't it ?
The clusters have separate clocks, but they share the same voltage supply.[1]
So two independent policies would be unsafe: one policy could lower the shared
voltage while the other cluster is still running at a higher frequency.
This means they can't use different policies.
From a hardware perspective, the eight cores of the K1 are homogeneous,
so using the same policy for them is relatively reasonable.
I used a K1-specific driver because cpufreq-dt only manages one CPU clock
through the CPU device used for the OPP transition.
On K1, the policy needs to control two independent cluster clocks and one shared
regulator, so the driver has to update the second cluster clock explicitly and
keep the ordering safe: raise voltage before raising either cluster, and lower
both cluster clocks before lowering the shared voltage.
[1] https://lore.kernel.org/spacemit/aeaXszeaE62rM6BJ@aurel32.net/
--
Best regards,
Shuwei Wu
next prev parent reply other threads:[~2026-06-15 6:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-12 9:51 [PATCH v3 0/2] cpufreq: spacemit: Add cpufreq support for K1 SoC Shuwei Wu
2026-06-12 9:51 ` [PATCH v3 1/2] cpufreq: spacemit: Add K1 cpufreq driver Shuwei Wu
2026-06-15 5:24 ` Viresh Kumar
2026-06-15 6:12 ` Shuwei Wu [this message]
2026-06-15 6:34 ` Viresh Kumar
2026-06-15 12:11 ` Shuwei Wu
2026-06-16 8:19 ` Viresh Kumar
2026-06-12 9:51 ` [PATCH v3 2/2] riscv: dts: spacemit: Add cpu scaling for K1 SoC Shuwei Wu
2026-06-14 6:50 ` [PATCH] riscv: dts: spacemit: orangepi-rv2: Add cpu scaling for K1, SoC Vincent Legoll
2026-06-15 0:41 ` Yixun Lan
2026-06-14 12:28 ` [PATCH] riscv: dts: spacemit: k1-musepi-pro: add cpu scaling Andre Heider
2026-06-15 5:07 ` [PATCH v3 0/2] cpufreq: spacemit: Add cpufreq support for K1 SoC Viresh Kumar
2026-06-20 14:23 ` Gong Shuai
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=DJ9EFPG561VZ.1WGRYYHJ2W9J9@mailbox.org \
--to=shuwei.wu@mailbox.org \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlan@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=spacemit@lists.linux.dev \
--cc=viresh.kumar@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®