All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jagadeesh Kona" <jagadeesh.kona@oss.qualcomm.com>
Cc: linux-clk@vger.kernel.org
Subject: Re: [PATCH] clk: qcom: negcc-nord: Add frequencies for ne_gcc_sdcc4_apps_clk_src
Date: Fri, 09 Oct 2026 04:24:30 +0000	[thread overview]
Message-ID: <sashiko-outbox-164826@kernel.org> (raw)
In-Reply-To: <20261009-nord-sdcc-clk-v1-1-63351f25a165@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] clk: qcom: bitwise truncation of clock divider due to hid_width limit
--

commit 2477f758daf039725b34bfc8b46b211691bae410
Author: Jagadeesh Kona <jagadeesh.kona@oss.qualcomm.com>

clk: qcom: negcc-nord: Add frequencies for ne_gcc_sdcc4_apps_clk_src
    
Add the frequency table entries for ne_gcc_sdcc4_apps_clk_src to support
the additional clock rates required on the Nord platform.

> diff --git a/drivers/clk/qcom/negcc-nord.c b/drivers/clk/qcom/negcc-nord.c
> index 68ce4d6278baa..a72fce70de45c 100644
> --- a/drivers/clk/qcom/negcc-nord.c
> +++ b/drivers/clk/qcom/negcc-nord.c
> @@ -436,6 +436,11 @@ static struct clk_rcg2 ne_gcc_qupv3_wrap2_s6_clk_src = {
>  };
>  
>  static const struct freq_tbl ftbl_ne_gcc_sdcc4_apps_clk_src[] = {
> +	F(144000, P_BI_TCXO, 16, 3, 25),
> +	F(400000, P_BI_TCXO, 12, 1, 4),
> +	F(19200000, P_BI_TCXO, 1, 0, 0),
> +	F(20000000, P_NE_GCC_GPLL0_OUT_MAIN, 30, 0, 0),
> +	F(25000000, P_NE_GCC_GPLL0_OUT_MAIN, 24, 0, 0),

[Severity: High]
Does this configuration overflow the hardware divider field?

In the F() macro, the half-integer divider (h) evaluates to a hardware
pre_div value of 2 * h - 1. For the new 20 MHz and 25 MHz frequencies
in ftbl_ne_gcc_sdcc4_apps_clk_src, using h values of 30 and 24 results
in hardware pre_div values of 59 and 47.

If the ne_gcc_sdcc4_apps_clk_src clock has a 5-bit hid_width, its maximum
supported pre_div value would be 31.

When __clk_rcg2_configure() applies this configuration, would these values
exceed the clear mask (0x1f), resulting in hardware truncation and
potential corruption of adjacent register bits?

Even if adjacent bits are ignored by the hardware, a truncated pre_div
value of 27 (from 59 & 31) means the effective divider becomes 14 instead
of 30, causing the clock to run at 42.85 MHz instead of 20 MHz.

Could this violate timing limits for the SD Card/eMMC controller and
lead to bus instability?

Could the M/N dividers be used for these rates instead, since .mnd_width
is available?

>  	F(37500000, P_NE_GCC_GPLL0_OUT_MAIN, 16, 0, 0),
>  	F(50000000, P_NE_GCC_GPLL0_OUT_MAIN, 12, 0, 0),
>  	F(100000000, P_NE_GCC_GPLL0_OUT_MAIN, 6, 0, 0),

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261009-nord-sdcc-clk-v1-1-63351f25a165@oss.qualcomm.com?part=1

  reply	other threads:[~2026-10-09  4:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09  4:15 [PATCH] clk: qcom: negcc-nord: Add frequencies for ne_gcc_sdcc4_apps_clk_src Jagadeesh Kona
2026-10-09  4:24 ` sashiko-bot [this message]
2026-10-09  4:27 ` Taniya Das

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-164826@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=jagadeesh.kona@oss.qualcomm.com \
    --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.