From: sashiko-bot@kernel.org
To: "Muhammad Huda Nugroho" <mhudan21@gmail.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI: qcom: Do not power off a PHY whose power-on failed
Date: Sat, 21 Nov 2026 11:41:30 +0000 [thread overview]
Message-ID: <sashiko-outbox-226985@kernel.org> (raw)
In-Reply-To: <20261121113721.7OL6u%mhudan21@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] PCI: qcom: missing Fixes trailer for qcom_pcie_phy_power_on()
unwind fix
--
commit e8e6c447938093b506280d02a806164618cf331c
Author: Muhammad Huda Nugroho <mhudan21@gmail.com>
> PCI: qcom: Do not power off a PHY whose power-on failed
>
> qcom_pcie_phy_power_on() unwinds a failed phy_power_on() by calling
> qcom_pcie_phy_power_off(), which walks the whole port list - including
> the port that just failed, and every port the loop has not reached yet.
> The phy_set_mode_ext() failure path returns without unwinding at all,
> leaking the ports already powered on.
>
> The first of those is not a leak but a refcount underflow.
> phy_power_off() decrements phy->power_count unconditionally and invokes
> the provider's ->power_off only at a count of 1, while phy_power_on()
> invokes ->power_on only at a count of 0. Releasing a reference that was
> never acquired therefore drives the count to -1, and the next
> phy_power_on() returns success having silently skipped powering the PHY
> up: no error, no message, just a PHY that is never initialised again.
>
> The damage outlives the failed attempt, which is what makes it worth
> fixing. On a single-port controller the very first failure is enough to
> reach -1. It is normally invisible because a failed host init at probe
> time is fatal anyway, but it becomes reachable as soon as anything
> retries host init at runtime, as system resume does - at which point the
> controller comes back with a PHY the core believes is already on.
>
> Unwind with list_for_each_entry_continue_reverse() so that only the
> ports successfully powered on are powered off, and route the
> phy_set_mode_ext() failure through the same unwind. The PHY core already
> releases the failed acquisition itself, so the failing port must not be
> released here.
>
> Signed-off-by: Muhammad Huda Nugroho <mhudan21@gmail.com>
[Severity: Low]
This fixes the error unwind in qcom_pcie_phy_power_on(). Should this
include:
Fixes: a2fbecdbbb9d ("PCI: qcom: Add support for parsing the new Root Port binding")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261121113721.7OL6u%mhudan21@gmail.com?part=1
prev parent reply other threads:[~2026-11-21 11:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-21 11:37 [PATCH] PCI: qcom: Do not power off a PHY whose power-on failed Muhammad Huda Nugroho
2026-11-21 11:41 ` 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-226985@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mhudan21@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox