From: sashiko-bot@kernel.org
To: "Mikko Perttunen" <mperttunen@nvidia.com>
Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 3/5] PCI: tegra264: Power endpoint devices before enumeration
Date: Fri, 04 Dec 2026 03:22:06 +0000 [thread overview]
Message-ID: <sashiko-outbox-249035@kernel.org> (raw)
In-Reply-To: <20261204-b4-t264-igpu-pci-v2-3-e36cd85f4778@nvidia.com>
Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [Medium] PCI: tegra264: tegra264_pcie_remove() cuts endpoint power
with PERST# high
- [Medium] PCI: tegra264: pci_host_probe() error path cuts power with
PERST# deasserted
- [Medium] PCI: tegra264: missing T_PVPERL delay before PERST#
deassertion after power-on
--
commit 9c6be8859c31ca1a1483c10b5694670e67b6b030
Author: Mikko Perttunen <mperttunen@nvidia.com>
PCI: tegra264: Power endpoint devices before enumeration
This commit integrates the Tegra264 PCIe host controller driver with the
PCI pwrctrl framework to power on endpoint devices before enumeration and
power them off on probe failure or removal, and selects
PCI_PWRCTRL_GENERIC in Kconfig.
> diff --git a/drivers/pci/controller/pcie-tegra264.c b/drivers/pci/controller/pcie-tegra264.c
> index c97576ab4a316..1d65ed5d0381b 100644
> --- a/drivers/pci/controller/pcie-tegra264.c
> +++ b/drivers/pci/controller/pcie-tegra264.c
[ ... ]
> @@ -391,6 +392,14 @@ static int tegra264_pcie_probe(struct platform_device *pdev)
> bridge->sysdata = pcie->cfg;
> pcie->ecam = pcie->cfg->win;
>
> + err = pci_pwrctrl_create_devices(dev);
> + if (err)
> + goto err_free_ecam;
> +
> + err = pci_pwrctrl_power_on_devices(dev);
> + if (err)
> + goto err_destroy_pwrctrl;
> +
> tegra264_pcie_init(pcie);
[Severity: Medium]
Should PERST# be asserted before pci_pwrctrl_power_on_devices() and held
for PCIE_T_PVPERL_MS before tegra264_pcie_init() deasserts it?
slot_pwrctrl_power_on() enables regulators and REFCLK without sleeping, and
tegra264_pcie_init() sets XTL_RC_MGMT_PERST_CONTROL_PERST_O_N immediately.
Without the 100 ms T_PVPERL stabilization delay, pwrctrl-managed slots and
endpoints can fail link training and cause probe to return -ENODEV.
[ ... ]
> @@ -402,17 +411,23 @@ static int tegra264_pcie_probe(struct platform_device *pdev)
> "PCIe #%u link is down and not hotplug-capable, turning off\n",
> pcie->ctl_id);
> tegra264_pcie_power_off(pcie);
> - goto err_free_ecam;
> + goto err_power_off;
> }
>
> err = pci_host_probe(bridge);
> if (err < 0) {
> dev_err_probe(dev, err, "failed to register Host Bridge\n");
> - goto err_free_ecam;
> + goto err_power_off;
> }
>
> return 0;
>
> +err_power_off:
> + pci_pwrctrl_power_off_devices(dev);
> +err_destroy_pwrctrl:
> + /* Keep devices registered so their drivers can bind before we retry. */
> + if (err != -EPROBE_DEFER)
> + pci_pwrctrl_destroy_devices(dev);
[Severity: Medium]
Can the pci_host_probe() failure path cut endpoint power while PERST# is
still deasserted and the link is active?
Unlike the link-down path above, this jumps straight to err_power_off
without asserting PERST# or calling tegra264_pcie_power_off(). Powering
off endpoint supplies, REFCLK, and PM domains with PERST# high violates
PCIe power-down sequencing and forces a surprise link down.
[ ... ]
> @@ -437,6 +452,9 @@ static void tegra264_pcie_remove(struct platform_device *pdev)
> pci_remove_root_bus(pcie->bridge->bus);
> pci_unlock_rescan_remove();
>
> + pci_pwrctrl_power_off_devices(&pdev->dev);
> + pci_pwrctrl_destroy_devices(&pdev->dev);
[Severity: Medium]
Does powering off and destroying the pwrctrl devices here drop the link and
break unbind/rebind?
tegra264_pcie_remove() intentionally leaves PERST# deasserted so the link
stays up for rebind. Here pci_pwrctrl_power_off_devices() cuts endpoint
supplies and REFCLK, and pci_pwrctrl_destroy_devices() powers off the
endpoint PM domain via device_unbind_cleanup() while PERST# remains high.
This violates PCIe power-down sequencing and forces a surprise link down.
On rebind, XTL_RC_MGMT_PERST_CONTROL_PERST_O_N is already set, so
tegra264_pcie_init() emits no reset pulse and link re-establishment fails
without a controller reset.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-b4-t264-igpu-pci-v2-0-e36cd85f4778@nvidia.com?part=3
next prev parent reply other threads:[~2026-12-04 3:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 3:05 [PATCH v2 0/5] Tegra264 GB10B boards the bus Mikko Perttunen
2026-12-04 3:05 ` [PATCH v2 1/5] PCI/pwrctrl: Enable pwrctrl for devices powered by a power domain Mikko Perttunen
2026-12-04 3:05 ` [PATCH v2 2/5] PCI/pwrctrl: Add the Tegra264 iGPU to the generic match table Mikko Perttunen
2026-12-04 3:27 ` sashiko-bot
2026-12-04 3:05 ` [PATCH v2 3/5] PCI: tegra264: Power endpoint devices before enumeration Mikko Perttunen
2026-12-04 3:22 ` sashiko-bot [this message]
2026-12-04 3:05 ` [PATCH v2 4/5] arm64: tegra: Add node for the GB10B GPU on Tegra264 Mikko Perttunen
2026-12-04 3:26 ` sashiko-bot
2026-12-04 3:05 ` [PATCH v2 5/5] arm64: tegra: Enable and mark the Tegra264 GPU PCIe controller as ATS supported Mikko Perttunen
2026-12-04 3:18 ` sashiko-bot
2026-12-04 3:27 ` [PATCH v2 0/5] Tegra264 GB10B boards the bus 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=sashiko-outbox-249035@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mperttunen@nvidia.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