All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Alexey Klimov" <alexey.klimov@linaro.org>
Cc: linux-clk@vger.kernel.org
Subject: Re: [PATCH RFC 2/2] clk: samsung: acpm: recalculate parent chain rates on Exynos850
Date: Sun, 06 Dec 2026 02:59:08 +0000	[thread overview]
Message-ID: <sashiko-outbox-252096@kernel.org> (raw)
In-Reply-To: <20261206-e850_acpm_clks_unstale-v1-2-3eda94959b0b@linaro.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] clk: samsung: CLK_GET_RATE_RECALC_ANCESTORS ignores mux
  switches on Exynos850
--

commit 72f8fd076942edb559374323ade796c613446bde
Author: Alexey Klimov <alexey.klimov@linaro.org>

clk: samsung: acpm: recalculate parent chain rates on Exynos850

This commit switches Exynos850 ACPM clocks from CLK_GET_RATE_NOCACHE to
CLK_GET_RATE_RECALC_ANCESTORS so the clock framework recalculates parent
rates when an ACPM clock rate is queried or set.

> diff --git a/drivers/clk/samsung/clk-acpm.c b/drivers/clk/samsung/clk-acpm.c
> index d5f1e73e05f8b..2a9a164946b40 100644
> --- a/drivers/clk/samsung/clk-acpm.c
> +++ b/drivers/clk/samsung/clk-acpm.c
> @@ -128,12 +128,16 @@ static int acpm_clk_register(struct device *dev, struct acpm_clk *aclk,
>  	init.ops = &acpm_clk_ops;
>  	aclk->hw.init = &init;
>  
> -	/* If get_rate is set, the SoC relies on parent topology */
> +	/*
> +	 * If get_rate is set, the SoC relies on parent topology. The firmware
> +	 * and the hardware can change the rates of the parent chain behind the
> +	 * clock framework's back, so re-read the whole chain on every request.
> +	 */
>  	if (drv_data->get_rate) {
>  		pdata.fw_name = name;
>  		init.parent_data = &pdata;
>  		init.num_parents = 1;
> -		init.flags = CLK_GET_RATE_NOCACHE;
> +		init.flags = CLK_GET_RATE_RECALC_ANCESTORS;
>  	}

[Severity: Medium]
Does CLK_GET_RATE_RECALC_ANCESTORS actually handle mux switches on
Exynos850?

clk_core_recalc_ancestors() only walks cached core->parent links and calls
clk_recalc(), never ops->get_parent().  Samsung CMU muxes use clk_mux_ops
with no recalc_rate callback, so mux registers are never re-read (as noted
in commit "clk: add CLK_GET_RATE_RECALC_ANCESTORS flag").

On Exynos850, DVFS domains without dedicated PLLs such as int (CMU_CORE)
rely on CMU_TOP muxes selecting among shared PLL dividers.  When ACPM
firmware switches such a mux, clk_get_rate() still returns the stale rate
from the cached parent and clk_set_rate() can drop a request for that rate.

The commit message also states that mux registers are re-read, which does
not match clk_core_recalc_ancestors().  Either clk_core_recalc_ancestors()
needs to re-read mux parents via get_parent(), or the commit message should
reflect that mux switches are not detected.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261206-e850_acpm_clks_unstale-v1-0-3eda94959b0b@linaro.org?part=2

      reply	other threads:[~2026-12-06  2:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-06  2:42 [PATCH RFC 0/2] clk: introduce CLK_GET_RATE_RECALC_ANCESTORS flag for firmware-controlled clocks Alexey Klimov
2026-12-06  2:42 ` [PATCH RFC 1/2] clk: add CLK_GET_RATE_RECALC_ANCESTORS flag Alexey Klimov
2026-12-06  3:05   ` sashiko-bot
2026-12-06  2:42 ` [PATCH RFC 2/2] clk: samsung: acpm: recalculate parent chain rates on Exynos850 Alexey Klimov
2026-12-06  2:59   ` sashiko-bot [this message]

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=sashiko-outbox-252096@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alexey.klimov@linaro.org \
    --cc=linux-clk@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.