All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Praveen Talari" <praveen.talari@oss.qualcomm.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH v3 1/8] soc: qcom: geni-se: Populate clk_perf_tbl with SE source clock frequencies from perf OPP table
Date: Thu, 15 Oct 2026 13:10:49 +0000	[thread overview]
Message-ID: <sashiko-outbox-172901@kernel.org> (raw)
In-Reply-To: <20261015-derive_clk_perf_tbl_from_perf_domain_opp_table-v3-1-5da1096243c9@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] soc: qcom: geni-se: clk_perf_tbl populated with OPP levels instead of frequencies
--

commit 2006551310c45129142551fa77079692b29b39f8
Author: Praveen Talari <praveen.talari@oss.qualcomm.com>

soc: qcom: geni-se: Populate clk_perf_tbl with SE source clock frequencies from perf OPP table

This commit aims to populate clk_perf_tbl using the OPP table exposed on
the perf domain device. This is intended to allow protocol drivers on the
firmware managed path to calculate required dividers and pick supported
source clock frequencies similarly to the Linux clock managed path.

> diff --git a/drivers/soc/qcom/qcom-geni-se.c b/drivers/soc/qcom/qcom-geni-se.c
> index 074087c592cc3..95eeb9438a292 100644
> --- a/drivers/soc/qcom/qcom-geni-se.c
> +++ b/drivers/soc/qcom/qcom-geni-se.c
[ ... ]
> @@ -1170,7 +1171,12 @@ int geni_se_domain_attach(struct geni_se *se)
[ ... ]
> +	level = 0;
> +	for (i = 0; i < num_opps; i++) {
> +		opp = dev_pm_opp_find_level_ceil(perf_dev, &level);
> +		if (IS_ERR(opp))
> +			return PTR_ERR(opp);
> +
> +		se->clk_perf_tbl[i] = level;

[Severity: High]
Does this populate clk_perf_tbl with abstract performance levels instead of
actual clock frequencies?

The commit message states clk_perf_tbl should be populated with actual source
clock frequencies so protocol drivers can calculate dividers and set the rate
via dev_pm_opp_set_rate(). However, by using dev_pm_opp_find_level_ceil()
in geni_se_domain_attach(), it appears this loop stores the performance
level (an abstract index like 16 or 64) rather than the frequency in Hz.

For SCMI performance domains, this abstract level will break the divider math
in geni_se_clk_freq_match(), leading to massive deltas or invalid dividers.
It will also cause dev_pm_opp_set_rate() to receive tiny abstract levels
instead of Hz. Because dev_pm_opp_set_rate() searches the OPP table for a
matching frequency, passing the abstract level will incorrectly match the
lowest available frequency and likely break protocol communication.

Should this use dev_pm_opp_find_freq_ceil() and track a frequency variable
to store the actual rates in clk_perf_tbl?

> +		dev_pm_opp_put(opp);
> +		level++;
> +	}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261015-derive_clk_perf_tbl_from_perf_domain_opp_table-v3-0-5da1096243c9@oss.qualcomm.com?part=1

  reply	other threads:[~2026-10-15 13:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15 12:58 [PATCH v3 0/8] soc: qcom: geni: Derive SE clock configuration from OPP table on SA8255P Praveen Talari
2026-10-15 12:58 ` [PATCH v3 1/8] soc: qcom: geni-se: Populate clk_perf_tbl with SE source clock frequencies from perf OPP table Praveen Talari
2026-10-15 13:10   ` sashiko-bot [this message]
2026-10-15 12:58 ` [PATCH v3 2/8] soc: qcom: geni-se: Add helper to set SE clock rate via OPP Praveen Talari
2026-10-15 13:06   ` sashiko-bot
2026-10-15 12:58 ` [PATCH v3 3/8] soc: qcom: geni-se: Remove OPP rate reset from resource deactivation Praveen Talari
2026-10-15 13:16   ` sashiko-bot
2026-10-15 12:58 ` [PATCH v3 4/8] serial: qcom-geni: Use geni_se_set_rate() for source clock configuration Praveen Talari
2026-10-15 13:15   ` sashiko-bot
2026-10-15 12:58 ` [PATCH v3 5/8] spi: qcom-geni: Use geni_se_set_rate() for setting source clock frequency Praveen Talari
2026-10-15 13:09   ` sashiko-bot
2026-10-15 12:58 ` [PATCH v3 6/8] i2c: qcom-geni: Vote for SE clock rate using OPP Praveen Talari
2026-10-15 13:18   ` sashiko-bot
2026-10-15 12:58 ` [PATCH v3 7/8] i2c: qcom-geni: Use common GENI resource initialization helper Praveen Talari
2026-10-15 13:20   ` sashiko-bot
2026-10-15 12:58 ` [PATCH v3 8/8] i2c: qcom-geni: Use geni_se_set_rate() for setting source clock frequency Praveen Talari
2026-10-15 13:24   ` sashiko-bot

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-172901@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=praveen.talari@oss.qualcomm.com \
    --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.