From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796354527; b=Wh8bftl/DBrfkUfVDrLVvuSFv5tdTB2lEr0tNI+Vm0YtGn8Ud1r1SKcbi8j/fGd6V6hX S7Tjc5u/wbyQ8kl/aEGKTHInB9ryNnzbHJg1OSuZ32vw0Sf8iUz3A5o3IKIe37aHUzLDZ J7NCmzPvxlkpEK97Lnu9YYmgAurPndO95o83Hi7xABNRjbdkPUDjcwEb4renEpWQ1d80y VHTqAPJ/xTNDflAylomoDIqPFyciw+2KZ/ILEAgJrHH6YV4RhQIrYrim2RAg8+lyIq659 ODT1QLi1OY4JY+Y9tN4G9XwVEKRpavn2wel2GvGgOYAleM/6yl+lgPetqEhh018uqWA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796354527; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=I/o+ISvdEi+S7APtpDSCXOKT64SXq/Y5EpOeuGQCCAM=; b=mPVAg8BTomqUAjiixqnkWgUalW0v8K/Xo6IFlifYJ3Zstrwd0iM165EHRZtx8S4RQKp5 GNJaYGVqQZs+OcM8pd6/MbaQyj5atfrLFjFZmJcU2ch+ooI0ZJsE7sCvDKnB4RCOhNGfE czGPlgb0pxSPsrpekE9gGr4LGYA8E2+pd1LTc3TNVPCfAwZikBMkarzfBlZXztC1pZ1z1 VzdIyGlEeScWK6NdCyfOUDti0Uq1tyoM0AEAKEmmpYclpAWaR9dikwwfQxf2EqiZw67oA /wKVnKZhv4pUneeR2DdkjqrF1FfPNsMPwxi0bXk3Hed9HXBSCki34qd1KcCfd+4kY3g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nmwQV37v; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B69EB606A322; Fri, 4 Dec 2026 03:22:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nmwQV37v Received: by smtp.kernel.org (Postfix) with ESMTPSA id 252671F000CE; Fri, 4 Dec 2026 03:22:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796354527; bh=I/o+ISvdEi+S7APtpDSCXOKT64SXq/Y5EpOeuGQCCAM=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=nmwQV37vuM9kKBXwPu2tUYQmjGc5tFyVB230dHltJjTvaPDlxoJ38ab9G5aQVB5FG qxy/dh6SbNPXJPbUS8k1bT3RvvsnaXFWJMtiC6mF79y0z/ecbSYctyMMTxIspQ91An 6PHOtroaEH61JopFuTqy+UxMuftGmYd2rVHe2z0nt+2U09qqTdbEFO1epDbnomvDe0 Sg1RyrkXg3ah7Hnwe5SqHbK1tgeeFy6C2GF3E4yp9AfjpM/PbT9rs4/pU+6/6PMZFv Qyg7ftyMiRaMYYIKG2UFUmNFyzbI8/GEGxIu29V0fqjaMDghyjwtnIzRDXRBhlKgVm dQfzxcVkjbz5w== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 3/5] PCI: tegra264: Power endpoint devices before enumeration Reply-To: sashiko-reviews@lists.linux.dev To: "Mikko Perttunen" Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261204-b4-t264-igpu-pci-v2-3-e36cd85f4778@nvidia.com> References: <20261204-b4-t264-igpu-pci-v2-0-e36cd85f4778@nvidia.com> <20261204-b4-t264-igpu-pci-v2-3-e36cd85f4778@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 03:22:06 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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 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/control= ler/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_devic= e *pdev) > bridge->sysdata =3D pcie->cfg; > pcie->ecam =3D pcie->cfg->win; > =20 > + err =3D pci_pwrctrl_create_devices(dev); > + if (err) > + goto err_free_ecam; > + > + err =3D 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_devi= ce *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; > } > =20 > err =3D 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; > } > =20 > return 0; > =20 > +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 !=3D -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_devi= ce *pdev) > pci_remove_root_bus(pcie->bridge->bus); > pci_unlock_rescan_remove(); > =20 > + 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. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204-b4-t264-ig= pu-pci-v2-0-e36cd85f4778@nvidia.com?part=3D3