Linux RTC
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jerome Brunet" <jbrunet@baylibre.com>
Cc: linux-rtc@vger.kernel.org,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	conor+dt@kernel.org, linux-sunxi@lists.linux.dev,
	devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v3 6/8] clk: sunxi-ng: div: add read-only operation support
Date: Thu, 02 Jul 2026 08:26:20 +0000	[thread overview]
Message-ID: <20260702082620.C9FF81F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260702-a733-rtc-v3-6-eb2580374de6@baylibre.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] The existing ccu_div_determine_rate_helper incorrectly asks the hardware parent for a non-predivided rate when CLK_SET_RATE_PARENT is set, resulting in unvalidated parent rate requests.
--

commit 20e3c89e1fcae37e3eaf3a9be6d0c4e28094d07d
Author: Jerome Brunet <jbrunet@baylibre.com>

clk: sunxi-ng: div: add read-only operation support

This commit adds support for sunxi-ng read-only dividers to be used
by the a733 oscillator detection logic.

> diff --git a/drivers/clk/sunxi-ng/ccu_div.c b/drivers/clk/sunxi-ng/ccu_div.c
> index 62d680ccb524b..d1c8c7baa12dc 100644
> --- a/drivers/clk/sunxi-ng/ccu_div.c
> +++ b/drivers/clk/sunxi-ng/ccu_div.c
> @@ -84,6 +84,36 @@ static int ccu_div_determine_rate(struct clk_hw *hw,
>  					     req, ccu_div_determine_rate_helper, cd);
>  }

[Severity: High]
This is a pre-existing issue, but does ccu_div_determine_rate_helper
incorrectly ask the hardware parent for a non-predivided rate when
CLK_SET_RATE_PARENT is set?

When ccu_div_determine_rate is called on a clock with a pre-divider, it
delegates to ccu_mux_helper_determine_rate, which calls
ccu_div_determine_rate_helper. That helper then directly invokes
divider_determine_rate() which queries req->best_parent_hw for
req->rate * div.

Could this cause the clock core to query the upstream parent for a target
rate without accounting for the pre-divider? If the core subsequently sets
the parent rate to an unvalidated higher rate, it seems the parent PLL may
fail or clamp because it was asked for an achievable rate that it cannot
actually sustain when multiplied by the pre-divider.

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260702-a733-rtc-v3-0-eb2580374de6@baylibre.com?part=6

  reply	other threads:[~2026-07-02  8:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-02  8:09 [PATCH v3 0/8] clk: sun6i-rtc: Add support for Allwinner A733 SoC Jerome Brunet
2026-07-02  8:10 ` [PATCH v3 1/8] dt-bindings: rtc: sun6i: no clock-output-names on h616/r329 Jerome Brunet
2026-07-02  8:17   ` sashiko-bot
2026-07-02 13:23   ` Chen-Yu Tsai
2026-07-02 18:44   ` Conor Dooley
2026-07-02  8:10 ` [PATCH v3 2/8] dt-bindings: rtc: sun6i: add sun60i-a733 support Jerome Brunet
2026-07-02  8:16   ` sashiko-bot
2026-07-02 18:45   ` Conor Dooley
2026-07-02  8:10 ` [PATCH v3 3/8] clk: sunxi-ng: fix ccu probe clock unregister on error Jerome Brunet
2026-07-02  8:16   ` sashiko-bot
2026-07-02 13:23   ` Chen-Yu Tsai
2026-07-02  8:10 ` [PATCH v3 4/8] clk: sunxi-ng: sun6i-rtc: clean up DT usage Jerome Brunet
2026-07-02  8:21   ` sashiko-bot
2026-07-02  8:10 ` [PATCH v3 5/8] clk: sunxi-ng: sun6i-rtc: Add feature bit for IOSC calibration Jerome Brunet
2026-07-02  8:19   ` sashiko-bot
2026-07-02  8:10 ` [PATCH v3 6/8] clk: sunxi-ng: div: add read-only operation support Jerome Brunet
2026-07-02  8:26   ` sashiko-bot [this message]
2026-07-02  8:10 ` [PATCH v3 7/8] clk: sunxi-ng: sun6i-rtc: split main oscillator div and gate Jerome Brunet
2026-07-02  8:23   ` sashiko-bot
2026-07-02  8:10 ` [PATCH v3 8/8] clk: sunxi-ng: sun6i-rtc: add a733 support Jerome Brunet
2026-07-02  8:29   ` sashiko-bot
2026-07-02 23:59 ` [PATCH v3 0/8] clk: sun6i-rtc: Add support for Allwinner A733 SoC Enzo Adriano

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=20260702082620.C9FF81F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jbrunet@baylibre.com \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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