From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=83.223.78.233 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796286884; b=LTyUYOtv8dl+wTY6hH4Fd3JJXdU1zsHHmVlXMZ7fKm3Yw9uq+/WKXh7JKd1SuSNNURWB KkD++FuS+Xj2YpST0cpFn6uIzh7aY0oLpQapvXf5SCLhHIdSHsN7wR1bS78J4/04Oi0Pn Rcti3NmaehN0mweZunvgxAwqCIrAMsyzVuMUkyjV5hhesVFqfdXViKtcx39rVuxWESmhS mDe8w5wTKNlkkoUkkWQ1knzGRtPspyn6IcbZLS8YBM6fIbd/PEW0rJj4lhpiaBuQNd16y xUwAyM20XGo7gYmmqgaR1SVDh1FpcpMXcvSVdxpnfkly1oPmdVGMSkcXoF1NU9JdZKA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796286884; h=DMARC-Filter:Received:Received:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=ZVPickvvY+xX9YY+R5r1a5H4iJpqjcc4GeesQVliQm0=; b=vk2ikrNYfRlyiHPpyHGpNnqXZj1jDfgCM7y/fbYah7YLeS3KUaBa82/BbdXUBTfFJ2hH AfphNciy1S+W9HBZzqSnvnRYkMyUrguMTc3VhEi1VGZRnrBNKS8SOUBGnx/y1RoOIC6Tx ifxRnDqsg4Lvf9nbsQvS9CVmwyglEIAjl2XJ6Bje8U2U5XWtSZumwCgGRfvtRlNrh6Csa 5J03tKq6TpU84t856bmwQOREafDKccfBpCfhpums3VGzAtwaRBWrjKllRroAf/wHavp/V SEBWQ2LWzIEnhu3x4Mfp8IlQNM5D+Kd78AQh4vM87TGkNUAtmBdYFURJvdjJgG4mODQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=wunner.de; spf=pass smtp.mailfrom=wunner.de; arc=none smtp.remote-ip=83.223.78.233 Received: from mailout2.hostsharing.net (mailout2.hostsharing.net [83.223.78.233]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C271606A322; Thu, 3 Dec 2026 08:34:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8C271606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wunner.de Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "*.hostsharing.net", Issuer "GlobalSign GCC R6 AlphaSSL CA 2025" (verified OK)) by mailout2.hostsharing.net (Postfix) with ESMTPS id C5BB478EB; Thu, 03 Dec 2026 09:34:33 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id ADCA3600E1C3; Thu, 3 Dec 2026 09:34:33 +0100 (CET) Date: Thu, 3 Dec 2026 09:34:33 +0100 From: Lukas Wunner To: Brett Creeley Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Eric Joyner , "Nikhil P. Rao" Subject: Re: [PATCH RFC 2/3] PCI: Allow quirks to extend the link-up wait after reset Message-ID: References: <20261202-b4-pci-link-up-timeout-v1-0-04fba0824d63@amd.com> <20261202-b4-pci-link-up-timeout-v1-2-04fba0824d63@amd.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261202-b4-pci-link-up-timeout-v1-2-04fba0824d63@amd.com> On Wed, Dec 02, 2026 at 04:43:27PM -0800, Brett Creeley wrote: > +++ b/drivers/pci/pci.c > @@ -4614,12 +4614,14 @@ static int pci_pm_reset(struct pci_dev *dev, bool probe) > * @pdev: Device whose link to wait for. > * @use_lt: Use the LT bit if TRUE, or the DLLLA bit if FALSE. > * @active: Waiting for active or inactive? > + * @timeout_ms: How long to wait for the status change (in ms) > * > * Return 0 if successful, or -ETIMEDOUT if status has not changed within > - * PCIE_LINK_RETRAIN_TIMEOUT_MS milliseconds. > + * @timeout_ms milliseconds. > */ > static int pcie_wait_for_link_status(struct pci_dev *pdev, > - bool use_lt, bool active) > + bool use_lt, bool active, > + unsigned int timeout_ms) > { Can you make it so that pcie_wait_for_link_status() doesn't take an extra parameter, but uses pdev->link_up_timeout in lieu of PCIE_LINK_RETRAIN_TIMEOUT_MS if it is non-zero? That would simplify the patch considerably. Patches that deal with non-conforming hardware should be minimally intrusive. > @@ -4833,7 +4875,9 @@ int pci_bridge_wait_for_secondary_bus(struct pci_dev *dev, char *reset_type) > > /* Take d3cold_delay requirements into account */ > delay = pci_bus_max_d3cold_delay(dev->subordinate); > - if (!delay) { > + link_up_timeout = pci_bus_max_link_up_timeout(dev->subordinate); > + extended = pcie_link_up_timeout_extended(dev, link_up_timeout); > + if (!delay && !extended) { > up_read(&pci_bus_sem); > return 0; > } Why is this needed? I'd expect the control flow to just fall through to the !pcie_wait_for_link_delay() at the end of pci_bridge_wait_for_secondary_bus()? > +++ b/include/linux/pci.h > @@ -434,6 +434,7 @@ struct pci_dev { > unsigned int no_bw_notif:1; /* BW notifications may cause issues */ > unsigned int d3hot_delay; /* D3hot->D0 transition time in ms */ > unsigned int d3cold_delay; /* D3cold->D0 transition time in ms */ > + unsigned int link_up_timeout; /* Link-up wait (ms), >5 GT/s ports */ > I'd preer link_up_delay for consistency with the other fields in the struct. I'm not sure the >5 GT/s limitation needs to be mentioned. Thanks, Lukas