Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Krishna Chaitanya Chundru" <krishna.chundru@oss.qualcomm.com>
Cc: robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 30/37] arm64: dts: qcom: sm8250: Move PCIe phy and GPIOs to root port node
Date: Thu, 11 Jun 2026 05:24:06 +0000	[thread overview]
Message-ID: <20260611052406.910431F00898@smtp.kernel.org> (raw)
In-Reply-To: <20260611-wake-v2-30-2744251b1181@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:

New issues:
- [Medium] The commit message claims to move `phy-names` to the root port nodes, but the property is actually deleted and not added.
- [Medium] `wake-gpios` is moved to the root port child node, but it is not permitted by the `qcom,pcie-common.yaml` schema for child nodes.

Pre-existing issues:
- [High] Missing `phy_exit()` on error paths in `qcom_pcie_parse_port()` and `qcom_pcie_parse_legacy_binding()` leading to PHY resource leaks.
--

commit b2d52b29841e8c337d148f97ebcff12f728d5a5f
Author: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>

arm64: dts: qcom: sm8250: Move PCIe phy and GPIOs to root port node

The PCIe phy reference and the perst/wake GPIO properties are
per root port and belong in the root port node (pcie@0), not in the
RC controller node.

> Move phys, phy-names, perst-gpios, and wake-gpios
> from the controller to the existing pcieport0 and newly labeled
> pcie1_port0 and pcie2_port0, allowing board-level overrides. Rename

[Severity: Medium]
The commit message explicitly states that phy-names is being moved to the
root port nodes. However, the diff shows it is being deleted from the parent
controller nodes but never added to the destination root port child nodes.

While omitting phy-names might be structurally correct according to the
bindings, does the implementation contradicting the stated intent in the
commit message represent a regression?

> diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
> index eca66d1c1c5b7..a5e2a16f6213e 100644
> --- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi
> @@ -2198,12 +2198,6 @@ pcie0: pcie@1c00000 {
>  
>  			power-domains = <&gcc PCIE_0_GDSC>;
>  
> -			phys = <&pcie0_phy>;
> -			phy-names = "pciephy";
> -
> -			perst-gpios = <&tlmm 79 GPIO_ACTIVE_LOW>;
> -			wake-gpios = <&tlmm 81 GPIO_ACTIVE_LOW>;
> -
>  			pinctrl-names = "default";
>  			pinctrl-0 = <&pcie0_default_state>;
>  			dma-coherent;
> @@ -2218,6 +2212,10 @@ pcieport0: pcie@0 {
>  				#address-cells = <3>;
>  				#size-cells = <2>;
>  				ranges;
> +
> +				phys = <&pcie0_phy>;
> +				reset-gpios = <&tlmm 79 GPIO_ACTIVE_LOW>;
> +				wake-gpios = <&tlmm 81 GPIO_ACTIVE_LOW>;

[Severity: Medium]
Could moving wake-gpios to the pcie@0 child node introduce a schema
validation regression?

In Documentation/devicetree/bindings/pci/qcom,pcie-common.yaml, the
patternProperties for ^pcie@ has unevaluatedProperties: false and only
explicitly permits reg and phys. If wake-gpios is not a standard property
defined in /schemas/pci/pci-pci-bridge.yaml#, might this fail
dt_binding_check?


[Severity: High]
This is a pre-existing issue, but missing phy_exit() on error paths in
qcom_pcie_parse_port() and qcom_pcie_parse_legacy_binding() appears to
lead to PHY resource leaks.

In qcom_pcie_parse_port():

drivers/pci/controller/dwc/pcie-qcom.c:qcom_pcie_parse_port() {
    ...
	ret = phy_init(phy);
	if (ret)
		return ret;

	INIT_LIST_HEAD(&port->perst);

	ret = qcom_pcie_parse_perst(pcie, port, node);
	if (ret)
		return ret;
    ...
}

If qcom_pcie_parse_perst() fails (e.g., returning -EPROBE_DEFER when
failing to acquire the reset GPIO), the function returns the error
immediately without calling phy_exit(phy).

Because the newly allocated port has not yet been added to the pcie->ports
list, the error handling path in qcom_pcie_parse_ports() will not see this
PHY. Does this repeatedly leak clocks and regulators on probe deferral,
preventing power domains from collapsing?

The same pattern exists in qcom_pcie_parse_legacy_binding():

drivers/pci/controller/dwc/pcie-qcom.c:qcom_pcie_parse_legacy_binding() {
    ...
	ret = phy_init(phy);
	if (ret)
		return ret;

	port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL);
	if (!port)
		return -ENOMEM;

	perst = devm_kzalloc(dev, sizeof(*perst), GFP_KERNEL);
	if (!perst)
		return -ENOMEM;
    ...
}

Could these devm_kzalloc() calls also fail and leak the initialized PHY?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260611-wake-v2-0-2744251b1181@oss.qualcomm.com?part=30

  reply	other threads:[~2026-06-11  5:24 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11  4:58 [PATCH v2 00/37] arm64: dts: qcom: Fix PCIe wake GPIO polarity Krishna Chaitanya Chundru
2026-06-11  4:58 ` [PATCH v2 01/37] ARM: dts: qcom: sdx55: " Krishna Chaitanya Chundru
2026-06-11  4:58 ` [PATCH v2 02/37] arm64: dts: qcom: msm8996: " Krishna Chaitanya Chundru
2026-06-11  4:58 ` [PATCH v2 03/37] arm64: dts: qcom: sdm845: " Krishna Chaitanya Chundru
2026-06-11  4:58 ` [PATCH v2 04/37] arm64: dts: qcom: sc8180x: " Krishna Chaitanya Chundru
2026-06-11  4:58 ` [PATCH v2 05/37] arm64: dts: qcom: sm8150: " Krishna Chaitanya Chundru
2026-06-11  4:58 ` [PATCH v2 06/37] arm64: dts: qcom: sm8250: " Krishna Chaitanya Chundru
2026-06-11  4:58 ` [PATCH v2 07/37] arm64: dts: qcom: sm8350: " Krishna Chaitanya Chundru
2026-06-11  4:58 ` [PATCH v2 08/37] arm64: dts: qcom: sm8450: " Krishna Chaitanya Chundru
2026-06-11  4:58 ` [PATCH v2 09/37] arm64: dts: qcom: sm8550: " Krishna Chaitanya Chundru
2026-06-11  4:58 ` [PATCH v2 10/37] arm64: dts: qcom: sm8650: " Krishna Chaitanya Chundru
2026-06-11  4:58 ` [PATCH v2 11/37] arm64: dts: qcom: sm8750: " Krishna Chaitanya Chundru
2026-06-11  4:58 ` [PATCH v2 12/37] arm64: dts: qcom: kaanapali: " Krishna Chaitanya Chundru
2026-06-11  4:58 ` [PATCH v2 13/37] arm64: dts: qcom: sar2130p: " Krishna Chaitanya Chundru
2026-06-11  4:58 ` [PATCH v2 14/37] arm64: dts: qcom: monaco: " Krishna Chaitanya Chundru
2026-06-11  4:58 ` [PATCH v2 15/37] arm64: dts: qcom: lemans: " Krishna Chaitanya Chundru
2026-06-11  4:58 ` [PATCH v2 16/37] arm64: dts: qcom: sa8540p-ride: " Krishna Chaitanya Chundru
2026-06-11  4:58 ` [PATCH v2 17/37] arm64: dts: qcom: kodiak: " Krishna Chaitanya Chundru
2026-06-11  4:58 ` [PATCH v2 18/37] arm64: dts: qcom: talos: " Krishna Chaitanya Chundru
2026-06-11  4:58 ` [PATCH v2 19/37] arm64: dts: qcom: lemans: Move PCIe phy and GPIOs to root port node Krishna Chaitanya Chundru
2026-06-11  4:58 ` [PATCH v2 20/37] arm64: dts: qcom: msm8998: " Krishna Chaitanya Chundru
2026-06-11  5:12   ` sashiko-bot
2026-06-11  4:58 ` [PATCH v2 21/37] arm64: dts: qcom: qcs404: " Krishna Chaitanya Chundru
2026-06-11  5:13   ` sashiko-bot
2026-06-11  4:58 ` [PATCH v2 22/37] arm64: dts: qcom: qcs8550: Move PCIe " Krishna Chaitanya Chundru
2026-06-11  5:15   ` sashiko-bot
2026-06-11  4:58 ` [PATCH v2 23/37] arm64: dts: qcom: sa8295p: " Krishna Chaitanya Chundru
2026-06-11  7:48   ` Konrad Dybcio
2026-06-11  4:59 ` [PATCH v2 24/37] arm64: dts: qcom: sa8540p: " Krishna Chaitanya Chundru
2026-06-11  4:59 ` [PATCH v2 25/37] arm64: dts: qcom: sar2130p: Move PCIe phy and " Krishna Chaitanya Chundru
2026-06-11  4:59 ` [PATCH v2 26/37] arm64: dts: qcom: sc8180x: " Krishna Chaitanya Chundru
2026-06-11  5:19   ` sashiko-bot
2026-06-11  7:49   ` Konrad Dybcio
2026-06-11  4:59 ` [PATCH v2 27/37] arm64: dts: qcom: sc8280xp: " Krishna Chaitanya Chundru
2026-06-11  4:59 ` [PATCH v2 28/37] arm64: dts: qcom: sdm845: " Krishna Chaitanya Chundru
2026-06-11  5:21   ` sashiko-bot
2026-06-11  4:59 ` [PATCH v2 29/37] arm64: dts: qcom: sm8150: " Krishna Chaitanya Chundru
2026-06-11  5:21   ` sashiko-bot
2026-06-11  4:59 ` [PATCH v2 30/37] arm64: dts: qcom: sm8250: " Krishna Chaitanya Chundru
2026-06-11  5:24   ` sashiko-bot [this message]
2026-06-11  4:59 ` [PATCH v2 31/37] arm64: dts: qcom: sm8350: " Krishna Chaitanya Chundru
2026-06-11  5:21   ` sashiko-bot
2026-06-11  4:59 ` [PATCH v2 32/37] arm64: dts: qcom: sm8450: " Krishna Chaitanya Chundru
2026-06-11  5:23   ` sashiko-bot
2026-06-11  4:59 ` [PATCH v2 33/37] arm64: dts: qcom: sm8550: " Krishna Chaitanya Chundru
2026-06-11  5:25   ` sashiko-bot
2026-06-11  4:59 ` [PATCH v2 34/37] arm64: dts: qcom: talos: " Krishna Chaitanya Chundru
2026-06-11  5:22   ` sashiko-bot
2026-06-11  4:59 ` [PATCH v2 35/37] arm64: dts: qcom: sm8650: " Krishna Chaitanya Chundru
2026-06-11  5:24   ` sashiko-bot
2026-06-11  4:59 ` [PATCH v2 36/37] arm64: dts: qcom: kodiak: " Krishna Chaitanya Chundru
2026-06-11  5:26   ` sashiko-bot
2026-06-11  4:59 ` [PATCH v2 37/37] arm64: dts: qcom: msm8996: " Krishna Chaitanya Chundru
2026-06-11  7: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=20260611052406.910431F00898@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krishna.chundru@oss.qualcomm.com \
    --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