Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>
Cc: linux-pci@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH 6/7] arm64: dts: qcom: sm8350: modernize PCIe entries
Date: Mon, 01 Jun 2026 10:24:56 +0000	[thread overview]
Message-ID: <20260601102457.223FF1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260601-sm8350-wifi-v1-6-242917d88031@oss.qualcomm.com>

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

Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but moving the reset GPIO lookup to the root port node exposes a pre-existing resource leak in `qcom_pcie_parse_port()`. The function initializes the PHY via `phy_init(phy)`. Immediately afterward, it calls `qcom_pcie_parse_perst()` to acquire the reset GPIO. If `qcom_pcie_parse_perst()` fails (e.g., returning `-EPROBE_DEFER` because the GPIO controller is not yet ready), `qcom_pcie_parse_port()` exits immediately and returns the error without calling `phy_exit(phy)`. Because the `port` structure is only added to the `pcie->ports` list at the very end of the function, the cleanup block in the caller `qcom_pcie_parse_ports()` skips this newly allocated port and fails to execute `phy_exit()`. This results in leaked PHY initialization references.
--

commit d344e05b9227f3ae995aa63413819de4bd38ce62
Author: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

arm64: dts: qcom: sm8350: modernize PCIe entries

This commit modernizes the device tree for the SM8350 platform by moving
the PERST# / WAKE pins and PHYs to the PCIe port instead of the RC device
to resolve recent kernel warnings.

> diff --git a/arch/arm64/boot/dts/qcom/sm8350-hdk.dts b/arch/arm64/boot/dts/qcom/sm8350-hdk.dts
> index 5f975d0094658..4973a3eb11b5b 100644
> --- a/arch/arm64/boot/dts/qcom/sm8350-hdk.dts
> +++ b/arch/arm64/boot/dts/qcom/sm8350-hdk.dts

[ ... ]

> @@ -493,12 +493,14 @@ &pcie0 {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&pcie0_default_state>;
>  
> -	perst-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
> -	wake-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
> -
>  	status = "okay";
>  };
>  
> +&pcie0_port0 {
> +	reset-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
> +	wake-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
> +};

[Severity: High]
This is a pre-existing issue, but moving the reset GPIO lookup to the root
port node exposes a resource leak in the driver's error handling.

If the GPIO controller is not yet ready and qcom_pcie_parse_perst() defers,
does the driver leak the PHY initialization reference?

Looking at drivers/pci/controller/dwc/pcie-qcom.c:qcom_pcie_parse_port(),
the function initializes the PHY:

    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;

When qcom_pcie_parse_perst() returns an error, the function returns
immediately without calling phy_exit(phy). Because the port structure is only
added to the pcie->ports list at the very end of the function, the cleanup
block in the caller qcom_pcie_parse_ports() skips this newly allocated port
and fails to execute phy_exit().

Could this keep the PHY permanently enabled across probe deferrals, and
should the error path be updated to ensure phy_exit() is called?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260601-sm8350-wifi-v1-0-242917d88031@oss.qualcomm.com?part=6

  reply	other threads:[~2026-06-01 10:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-01  9:46 [PATCH 0/7] arm64: dts: qcom: enable WiFi/BT on SM8350 HDK Dmitry Baryshkov
2026-06-01  9:46 ` [PATCH 1/7] PCI: qcom: fix parsing of PERST# in the legacy case Dmitry Baryshkov
2026-06-01  9:59   ` sashiko-bot
2026-06-01  9:46 ` [PATCH 2/7] wifi: ath11k: enable support for WCN6851 Dmitry Baryshkov
2026-06-01 10:08   ` sashiko-bot
2026-06-01 13:54   ` Jeff Johnson
2026-06-01  9:46 ` [PATCH 3/7] regulator: dt-bindings: qcom,qca6390-pmu: document WCN6851 Dmitry Baryshkov
2026-06-01  9:46 ` [PATCH 4/7] dt-bindings: bluetooth: qcom,wcn6855-bt: " Dmitry Baryshkov
2026-06-01  9:46 ` [PATCH 5/7] arm64: dts: qcom: sm8350: expand UART18 to 4 pins config Dmitry Baryshkov
2026-06-01  9:46 ` [PATCH 6/7] arm64: dts: qcom: sm8350: modernize PCIe entries Dmitry Baryshkov
2026-06-01 10:24   ` sashiko-bot [this message]
2026-06-01  9:46 ` [PATCH 7/7] arm64: dts: qcom: sm8350-hdk: describe WiFi/BT chip Dmitry Baryshkov

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=20260601102457.223FF1F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=linux-pci@vger.kernel.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