All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sreeshankar K" <sreeshankar0910@gmail.com>
Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v15 8/8] arm64: dts: qcom: Add SM7250 devicetree file
Date: Mon, 16 Nov 2026 06:16:22 +0000	[thread overview]
Message-ID: <sashiko-outbox-216254@kernel.org> (raw)
In-Reply-To: <20261116-sm7250-v15-8-6acbb232fef8@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] cpufreq: qcom-hw: partial init and resource leak in
  qcom_cpufreq_hw_cpu_init()
- [Low] arm64: dts: qcom: sm7250: oversized PDC register region in pdc
  node
--

commit a2793b66bb2274241a395fec222892481d4a324f
Author: Sreeshankar K <sreeshankar0910@gmail.com>

arm64: dts: qcom: Add SM7250 devicetree file

This commit adds the base devicetree file for the Qualcomm SM7250 SoC,
including CPU, PSCI, clock, interrupt, and serial console nodes.

> diff --git a/arch/arm64/boot/dts/qcom/sm7250.dtsi b/arch/arm64/boot/dts/qcom/sm7250.dtsi
> new file mode 100644
> index 0000000000000..231b6ea59a590
> --- /dev/null
> +++ b/arch/arm64/boot/dts/qcom/sm7250.dtsi
[ ... ]
> +		pdc: interrupt-controller@b220000 {
> +			compatible = "qcom,sm7250-pdc", "qcom,pdc";
> +			reg = <0 0xb220000 0 0x30000>, <0 0x17c000f0 0 0x60>;

[Severity: Low]
Should the first reg region size be 0x10000 instead of 0x30000?

qcom_pdc_probe() maps max_t(resource_size_t, resource_size(&res),
PDC_DRV_SIZE) where PDC_DRV_SIZE is 0x10000, so specifying 0x30000 maps
three PDC DRV regions instead of just the OS PDC DRV region.

[ ... ]

> +		cpufreq_hw: cpufreq@18323000 {
> +			compatible = "qcom,sm7250-cpufreq-hw", "qcom,cpufreq-hw";
> +			reg = <0 0x18323000 0 0x1000>,
> +			      <0 0x18325800 0 0x1000>,
> +			      <0 0x18327800 0 0x1000>;
> +			reg-names = "freq-domain0",
> +				    "freq-domain1",
> +				    "freq-domain2";
> +			interrupts-extended = <&lmh_cluster0 0>,
> +					      <&lmh_cluster1 0>;
> +			interrupt-names = "dcvsh-irq-0",
> +					  "dcvsh-irq-1";

[Severity: Medium]
Can defining two LMh interrupts across three frequency domains cause
partial cpufreq initialization, leaked frequency tables, and dangling
data->policy pointers?

If qcom_cpufreq_hw_driver_probe() runs when lmh_cluster0 and lmh_cluster1
have not registered their IRQ domains (for example with
CONFIG_ARM_QCOM_CPUFREQ_HW=y and CONFIG_QCOM_LMH=n, or before qcom-lmh.ko
loads), platform_get_irq_optional(pdev, index) in
qcom_cpufreq_hw_lmh_init() fails for domains 0 and 1 (CPUs 0..6) but
returns -ENXIO for domain 2 (CPU 7), which qcom_cpufreq_hw_lmh_init()
treats as success:

drivers/cpufreq/qcom-cpufreq-hw.c:qcom_cpufreq_hw_cpu_init() {
    ...
	data->policy = policy;

	ret = qcom_cpufreq_hw_read_lut(cpu_dev, policy);
	if (ret) {
		dev_err(dev, "Domain-%d failed to read LUT\n", index);
		return ret;
	}

	ret = dev_pm_opp_get_opp_count(cpu_dev);
	if (ret <= 0) {
		dev_err(cpu_dev, "Failed to add OPPs\n");
		return -ENODEV;
	}

	return qcom_cpufreq_hw_lmh_init(policy, index);
}

When qcom_cpufreq_hw_lmh_init() fails on CPUs 0..6, cpufreq_online()
skips cpufreq_driver->exit() and frees policy, leaking policy->freq_table
and dynamic OPPs while leaving data->policy pointing to the freed policy
(which qcom_cpufreq_hw_recalc_rate() later dereferences).  Because CPU 7
succeeds, cpufreq_register_driver() sees a non-empty cpufreq_policy_list
and returns 0 instead of deferring probe, leaving CPUs 0..6 without
cpufreq support.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261116-sm7250-v15-0-6acbb232fef8@gmail.com?part=8

      reply	other threads:[~2026-11-16  6:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  5:33 [PATCH v15 0/8] Add initial support for Qualcomm SM7250 SoC Sreeshankar K
2026-11-16  5:33 ` [PATCH v15 1/8] dt-bindings: clock: Add SM7250 global clock controller Sreeshankar K
2026-11-16  5:33 ` [PATCH v15 2/8] clk: qcom: Add Global Clock Controller (GCC) driver for SM7250 Sreeshankar K
2026-11-16  5:33 ` [PATCH v15 3/8] thermal/qcom/lmh: Switch to match data for SoC CPU-to-node mappings Sreeshankar K
2026-11-16  5:43   ` sashiko-bot
2026-11-16  5:33 ` [PATCH v15 4/8] dt-bindings: thermal: lmh: Document SM7250 LMh Sreeshankar K
2026-11-16  5:33 ` [PATCH v15 5/8] thermal/qcom/lmh: Add support for Qualcomm SM7250 Sreeshankar K
2026-11-16  5:33 ` [PATCH v15 6/8] dt-bindings: firmware: qcom,scm: Document SM7250 SCM Sreeshankar K
2026-11-16  5:33 ` [PATCH v15 7/8] dt-bindings: cpufreq: qcom-hw: Document SM7250 cpufreq hardware Sreeshankar K
2026-11-16  5:33 ` [PATCH v15 8/8] arm64: dts: qcom: Add SM7250 devicetree file Sreeshankar K
2026-11-16  6:16   ` 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-216254@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sreeshankar0910@gmail.com \
    /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.