Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Simon Glass" <sjg@chromium.org>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 02/12] clk: rockchip: Add clock controller for the RV1106
Date: Mon, 06 Jul 2026 20:15:48 +0000	[thread overview]
Message-ID: <20260706201548.DAFDD1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260706195818.3906949-3-sjg@chromium.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The CPU clock transition logic hardcodes the core divider to 1 (divide-by-2) in `pre_muxs`, which silently overwrites the safe dynamic divider calculated by the generic rockchip `clk-cpu` framework. This can cause the CPU to be severely overclocked relative to its current voltage during frequency transitions.
--

commit 0a7d739f9968c86bc3a23196e252f049408102b7
Author: Simon Glass <sjg@chromium.org>

clk: rockchip: Add clock controller for the RV1106

Add the clock controller driver for the Rockchip RV1106, based on the
driver from the vendor kernel by Elaine Zhang, following the structure
of the RV1103B driver.

Link: https://github.com/LuckfoxTECH/luckfox-pico

> diff --git a/drivers/clk/rockchip/clk-rv1106.c b/drivers/clk/rockchip/clk-rv1106.c
> new file mode 100644
> index 0000000000000..88f043f34c233
> --- /dev/null
> +++ b/drivers/clk/rockchip/clk-rv1106.c

[ ... ]

> +#define RV1106_CPUCLK_RATE(_prate, _aclk_core, _pclk_dbg, _is_pvtpll)	\
> +{									\
> +	.prate = _prate,						\
> +	.divs = {							\
> +		RV1106_CLKSEL0(_aclk_core),				\
> +		RV1106_CLKSEL1(_pclk_dbg),				\
> +	},								\
> +	.pre_muxs = {							\
> +		RV1106_CLKSEL3(1),					\

[Severity: High]
Does this hardcoded core divider safely integrate with the generic rockchip
clk-cpu framework?

The generic rockchip_cpuclk_pre_rate_change() framework computes a safe
alt_div during frequency transitions (e.g., from 96 MHz up to 216 MHz) so
the intermediate frequency stays safely below the target rate while voltage
adjusts.

It looks like writing 1 here via RV1106_CLKSEL3(1) will clobber that
dynamically calculated alt_div, since it writes exactly to the div_core
register field. If the CPU is forced to run at GPLL/2 (e.g., ~600 MHz)
while the voltage is only provisioned for 216 MHz, could this cause system
lockups or crashes due to undervoltage during cpufreq scaling?

> +		RV1106_CLKSEL2(2),					\
> +	},								\
> +	.post_muxs = {							\
> +		RV1106_CLKSEL2(_is_pvtpll),				\
> +		RV1106_CLKSEL3(0),					\
> +	},								\
> +}

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260706195818.3906949-1-sjg@chromium.org?part=2

  reply	other threads:[~2026-07-06 20:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06 19:57 [PATCH 00/12] Add support for the Rockchip RV1106 and RV1103 Simon Glass
2026-07-06 19:57 ` [PATCH 01/12] dt-bindings: clock: rockchip: Add RV1106 CRU support Simon Glass
2026-07-06 19:57 ` [PATCH 02/12] clk: rockchip: Add clock controller for the RV1106 Simon Glass
2026-07-06 20:15   ` sashiko-bot [this message]
2026-07-06 19:57 ` [PATCH 03/12] dt-bindings: pinctrl: rockchip: Add RV1106 compatible Simon Glass
2026-07-06 19:58 ` [PATCH 04/12] pinctrl: rockchip: Add RV1106 pinctrl support Simon Glass
2026-07-06 20:14   ` sashiko-bot
2026-07-06 19:58 ` [PATCH 05/12] dt-bindings: soc: rockchip: grf: Add RV1106 compatibles Simon Glass
2026-07-06 19:58 ` [PATCH 06/12] dt-bindings: serial: snps-dw-apb-uart: Add RV1106 compatible Simon Glass
2026-07-06 20:16   ` sashiko-bot
2026-07-06 19:58 ` [PATCH 07/12] dt-bindings: mmc: rockchip-dw-mshc: " Simon Glass
2026-07-06 19:58 ` [PATCH 08/12] dt-bindings: watchdog: snps,dw-wdt: " Simon Glass
2026-07-06 19:58 ` [PATCH 09/12] dt-bindings: iio: adc: rockchip-saradc: " Simon Glass
2026-07-07  2:09   ` Jonathan Cameron
2026-07-06 19:58 ` [PATCH 10/12] ARM: dts: rockchip: Add support for RV1106 and RV1103 Simon Glass
2026-07-06 20:17   ` sashiko-bot
2026-07-06 19:58 ` [PATCH 11/12] dt-bindings: arm: rockchip: Add Luckfox Pico Mini B Simon Glass
2026-07-06 20:18   ` sashiko-bot
2026-07-06 19:58 ` [PATCH 12/12] ARM: dts: " Simon Glass
2026-07-06 22:54 ` [PATCH 00/12] Add support for the Rockchip RV1106 and RV1103 Fabio Estevam
2026-07-07  7:41   ` Heiko Stübner

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=20260706201548.DAFDD1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sjg@chromium.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