mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Young-Jun Hong <nirvanah@nirvanahyj.com>
To: Henrik Grimler <henrik@grimler.se>
Cc: Krzysztof Kozlowski <krzk@kernel.org>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	Peter Griffin <peter.griffin@linaro.org>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Brian Masney <bmasney+clk@redhat.com>,
	Jerome Brunet <jbrunet+clk@baylibre.com>,
	linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: RE: Re: [PATCH 2/4] clk: samsung: exynos5420: add VPLL rates for 650, 700 and 750 MHz
Date: Sun, 22 Nov 2026 17:24:46 +0900 (KST)	[thread overview]
Message-ID: <gab995302678.0.1795335886363@nirvanahyj.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 4789 bytes --]

Hi Henrik,


Thanks for the review, and sorry for the slow reply.

On Fri, Nov 06, 2026 at 03:45:36PM +0100, Henrik Grimler wrote:
> What you mean with "using the same P/M/S style as the APLL rows"?

That wording is too loose, sorry. Let me explain how the rows were
chosen.

Why the VPLL needs new rows at all: the GPU clock is
fout_vpll -> mout_sclk_vpll -> mout_aclk_g3d -> dout_aclk_g3d (a 3-bit
divider, CLK_SET_RATE_PARENT) -> mout_sw/user_aclk_g3d -> g3d. The
divider can only divide down, so a G3D rate above 600 MHz needs a VPLL
row for it; without one, clk_set_rate() rounds to the 600 MHz row.

The VPLL is a pll_2550 (PLL35xx-style integer PLL), the same type as the
APLL, KPLL and BPLL in this driver:

  Fref = 24 MHz / P    (P: 6 bits)   input of the phase detector
  VCO  = Fref * M      (M: 10 bits)  feedback divider
  Fout = VCO / 2^S     (S: 3 bits)   post-divider, outside the loop

So what decides whether a row is reasonable is the phase detector input
(Fref) and the VCO frequency; S only divides the VCO output. I picked
rows whose Fref and VCO are both already used by pll_2550 rows in
mainline:

  rate  P  M    S  Fref    VCO       same Fref / VCO already used
  650   6  325  1  4 MHz   1300 MHz  APLL 1300 MHz row (325, 6, 0)
  700   3  175  1  8 MHz   1400 MHz  APLL 700 MHz row (175, 3, 1);
                                     VPLL 350 MHz row (175, 3, 2)
  750   2  125  1  12 MHz  1500 MHz  Fref: VPLL 600/543/480/420 rows,
                                     APLL 1200/900; VCO: APLL 1500

Why S = 1 and not S = 2 like the existing VPLL rows: with S = 2, 650 to
750 MHz would need a VCO of 2600 to 3000 MHz, above the highest VCO any
pll_2550 table in mainline uses (2400 MHz, e.g. the VPLL 600 MHz row
200, 2, 2). With S = 1 the VCO stays at 1300 to 1500 MHz, the same range
the existing VPLL rows run in (350 MHz row: 1400 MHz; 177 MHz row: 1416;
100 MHz row: 1600). That is what "the same P/M/S style as the APLL rows"
was meant to say; I will spell it out like this in v2.

> Was it tested by a human?

Yes. The code was generated by Claude Code, but I set the direction of
the experiments, looked at the results myself, and repeated the runs on
my ARTIK 10 board until the results held up.

Some background: I am evaluating the ARTIK 10 (Exynos 5422) as a
small compute board. Starting from its factory Fedora image, I moved
it to Debian and tuned it for benchmarking, with Claude Code writing
most of the scripts and configuration changes. I defined the
experiments and how to validate them, analyzed the results myself,
and accepted a change only after it reproduced across repeated runs
on the board. For this patch, that means the clk_summary readings and
the fixed-clock GPU runs described below.

> Do you have any references, like vendor kernel sources, to back up
> these choices of dividers and scalar?

Not from a vendor kernel for this SoC: the ones I found for the Exynos
5422 (Hardkernel's ODROID-XU3/XU4 3.10 and 6.1 trees) also stop the VPLL
table at 600 MHz, and the mainline VPLL table (b92981de92cb, 2019) does
not say where its values came from.

The closest reference is in mainline. clk-exynos5260.c (d39e55e06371,
Samsung, 2014) has one table that it applies to all pll_2550 PLLs of
that SoC, including its G3D_PLL. It contains 700 MHz = 175, 3, 1 (the
same row as here), S = 1 rows from 633 to 1200 MHz (VCO 1266 to 2400
MHz), and the 1300 and 1500 MHz rows (325, 6, 0 and 250, 4, 0). So a
Samsung-written G3D PLL table on the same PLL type already runs the VCO
at 1300 to 1500 MHz with S = 1. The vendor 3.10 tree for the 5422 also
uses S = 1 on other pll_2550 instances (IPLL 666 MHz = P 4, M 222,
S 1; SPLL 800 MHz = P 3, M 200, S 1). I do not have the user manual,
so I have not checked the rows against its PLL limits.

On the board, clk_summary reports fout_vpll at 650, 700 and 750 MHz,
and GPU throughput follows the clock: between a fixed 600 MHz and a
fixed 750 MHz, an OpenCL mad4 loop goes from 31.1 to 38.7 GFLOPS and an
fp64 loop from 11.2 to 13.9 GFLOPS (ratio 1.24 for both; 1.25
expected).

In v2 I will change the 750 MHz row to 250, 4, 1 (the M/P of the
1500 MHz row of the pll_2550 table): same VCO and output, Fref 6
instead of 12 MHz, so all three rows reuse an existing M/P pair. I ran
that row on the board: fout_vpll and the GPU clock read 750 MHz, the
fixed clock results match the old row (fp64 13.8-14.0 GFLOPS at 750
MHz, 11.1 at 600 MHz), and a devfreq run between all OPPs showed no GPU
faults. The 650 MHz row (325, 6, 1) passed the same test (fp64 12.0
GFLOPS). The v2 changelog also describes the clock path and where the
values come from.

Best regards,
YJ

-- 
Young-Jun Hong from Hiworks

                 reply	other threads:[~2026-11-22  8:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=gab995302678.0.1795335886363@nirvanahyj.com \
    --to=nirvanah@nirvanahyj.com \
    --cc=alim.akhtar@samsung.com \
    --cc=bmasney+clk@redhat.com \
    --cc=cw00.choi@samsung.com \
    --cc=henrik@grimler.se \
    --cc=jbrunet+clk@baylibre.com \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=peter.griffin@linaro.org \
    --cc=s.nawrocki@samsung.com \
    --cc=sboyd@kernel.org \
    --cc=young.j.hong@kaist.ac.kr \
    /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®