Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Herman van Hazendonk" <github.com@herrie.org>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 2/2] interconnect: qcom: add MSM8x60 NoC driver
Date: Wed, 03 Jun 2026 18:56:42 +0000	[thread overview]
Message-ID: <20260603185642.9AF071F00898@smtp.kernel.org> (raw)
In-Reply-To: <20260603163410.2312712-3-github.com@herrie.org>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] Double/Triple counting of bandwidth leads to artificially inflated clock rates.
- [Low] Kconfig dependency allows built-in driver to reference module symbols, causing linker errors.
- [Low] The name field in struct msm8660_icc_node is incorrectly typed as unsigned char * instead of const char *.
--

commit 55dcd848add92308b8d692adbadfc253e5ad283f
Author: Herman van Hazendonk <github.com@herrie.org>

interconnect: qcom: add MSM8x60 NoC driver

Add a Qualcomm interconnect driver for the MSM8x60 family modelling the
four NoC fabrics (APPSS, System, MMSS, DFAB) that connect masters and
slaves on these Scorpion-class SoCs.

> diff --git a/drivers/interconnect/qcom/Kconfig b/drivers/interconnect/qcom/Kconfig
> --- a/drivers/interconnect/qcom/Kconfig
> +++ b/drivers/interconnect/qcom/Kconfig
[ ... ]
> +config INTERCONNECT_QCOM_MSM8660
> +	# bool, not tristate: this provider must be registered at
> +	# core_initcall to be ready before icc_init (subsys_initcall) walks
> +	# devicetree consumers; a loadable module cannot satisfy that
> +	# ordering. Build-in only.
> +	bool "Qualcomm MSM8x60 interconnect driver"
> +	depends on INTERCONNECT_QCOM=y
> +	depends on MFD_QCOM_RPM

[Severity: Low]
Does this allow the driver to be built-in while MFD_QCOM_RPM is a module?

Since INTERCONNECT_QCOM_MSM8660 is a bool symbol, depending on MFD_QCOM_RPM
without =y means this can be selected as =y even if MFD_QCOM_RPM=m. This
would result in undefined reference linker errors for qcom_rpm_write.

> diff --git a/drivers/interconnect/qcom/msm8660.c b/drivers/interconnect/qcom/msm8660.c
> --- /dev/null
> +++ b/drivers/interconnect/qcom/msm8660.c
[ ... ]
> +struct msm8660_icc_node {
> +	unsigned char *name;

[Severity: Low]
This isn't a bug, but should name be a const char * rather than unsigned
char *?

Initializing this with string literals (via the DEFINE_QNODE macro) and
assigning it to node->name (which expects const char *) results in compiler
warnings about pointer type mismatches.

[ ... ]
> +static int msm8660_icc_set(struct icc_node *src, struct icc_node *dst)
> +{
> +	struct msm8660_icc_node *src_qn;
> +	struct msm8660_icc_provider *qp;
> +	u64 sum_bw, max_peak_bw, rate;
> +	u32 agg_avg = 0, agg_peak = 0;
> +	struct icc_provider *provider;
> +	struct icc_node *n;
> +	int ret, i;
> +
> +	src_qn = src->data;
> +	provider = src->provider;
> +	qp = to_msm8660_icc_provider(provider);
> +
> +	list_for_each_entry(n, &provider->nodes, node_list)
> +		provider->aggregate(n, 0, n->avg_bw, n->peak_bw,
> +				    &agg_avg, &agg_peak);

[Severity: High]
Does this loop result in double counting the requested bandwidth?

Because an interconnect path traverses multiple nodes (e.g., a master and a
slave) and the framework applies the requested bandwidth to all nodes along
the path, summing all nodes in the provider means the same traffic is counted
multiple times.

This artificially inflates the computed clock rate, which could cause
clk_set_rate() to fail or unnecessarily waste power.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260603163410.2312712-1-github.com@herrie.org?part=2

  reply	other threads:[~2026-06-03 18:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-03 16:34 [PATCH 0/2] interconnect: qcom: add MSM8x60 (MSM8660/APQ8060) NoC driver Herman van Hazendonk
2026-06-03 16:34 ` [PATCH 1/2] dt-bindings: interconnect: qcom: add msm8660 fabric IDs Herman van Hazendonk
2026-06-03 18:42   ` sashiko-bot
2026-06-03 16:34 ` [PATCH 2/2] interconnect: qcom: add MSM8x60 NoC driver Herman van Hazendonk
2026-06-03 18:56   ` sashiko-bot [this message]
2026-06-03 22:54   ` Dmitry Baryshkov
2026-06-03 22:50 ` [PATCH 0/2] interconnect: qcom: add MSM8x60 (MSM8660/APQ8060) " Jie Gan
  -- strict thread matches above, loose matches on Subject: below --
2026-05-30 13:59 [PATCH 0/2] clk: qcom: add MSM8x60 LPASS Clock Controller Herman van Hazendonk
2026-05-30 14:00 ` [PATCH 2/2] interconnect: qcom: add MSM8x60 NoC driver Herman van Hazendonk
2026-05-30 14:14   ` 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=20260603185642.9AF071F00898@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=github.com@herrie.org \
    --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