From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.57.69 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796258622; b=kDhq2D8upWQgR0aITZGGHV21g9azlOY45lDuy4zk0W4sUHkdFVXveljXW3r3b9vgvcGu 4fbMa5r4tqJj6Nio9W6iAYXzt75/zbOL9EAT5GZO0GuX5eMaKMIz/2Q6g96tZkbn0eG/X HQRIu1rtJ8QCGJq+lmYPrAjDHTvQADYl7IlxZZkT+S1Cd9XWD96S6H3EfUY9PBNFmWjQf 04CCvnUaTY+2xUDJlKifmdNq6PIf+tuObpq3PaRdise95KgovfJfPItl0IkmOUQl2G5s0 0qwOMBFlcwCSglTmCWOjgxT57wwL/fFhmEdWAC8RQ9ZXN6jYkXwhQAoEiEgYqILpezw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796258622; h=DMARC-Filter:DKIM-Signature:Received:Received: X-MS-Exchange-Authentication-Results:Received-SPF:Received:Received: From:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To:CC:X-Mailer: X-Originating-IP:X-ClientProxiedBy:X-EOPAttributedMessage: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=zzT88LKbAJ7FyN0lxruP/0baJHQ5m6YjZQ7dGLYoLtc=; b=BK2I2SVFNBhn3K+RQmUfUMWfZ5Wr8SkxnSVROsoNTiiWKLfse365TpDD6sa4aDWJ/X9s QYXrX0u2w9fEeCk4O9Y5/ZF2vvCNgBUOUthym4LftRWDimpQ4GtyKjwW21PXCaRLctO+P 4iCDFEChd3AcygctSSFHkgFkSVkKgmEl830S4bgVEQTYWKPRWOnxKNtkeO+KU/TpB4Nxi MtF6GO3JpEd4dlVoS4n8mZMBmEeCnCZT6xf7MnQq6am7zCaoCmX9+fDdAzAwfua1kSnAv EAMpiOTY2aOI1XsILSX9QduHkmOXtq4SvGS1dpOq69jrqN0+fzT8X9x2bijFgC6uM1Q== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=g8tToXEa; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.57.69 Received: from BN8PR05CU002.outbound.protection.outlook.com (mail-eastus2azon11011069.outbound.protection.outlook.com [52.101.57.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF9C7606A32C; Thu, 3 Dec 2026 00:43:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CF9C7606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=g8tToXEa ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=drFSviUvcvaXjaDfQxl8iBo7D0oBut6reonwi9ONJhlnEPVk0cwVP5s8z6k38SMV1sn6jJrZN5yI3sm+Ki28n0bweVgXNrRT45yhKvgeuWspfDjG3ZG2t2Uig5sctkqlPmvYiABQjXUoEWN8wb7Ze/JX8E/MRLi3zFvD1uLeoDIedQTOLwiAnUQh6ClwYvIb46oiVMQCVShNzbyo/0UaPPS0BTEo4xkvTixfJZgTZJG1So7JcJ1HtMyWKscVv15Kd0/f8UV9MQ+Q9n2f7DmA51egBGvelqKlKs0sVq7Z6NpBm6mo0BUjThKTda3/hwUplfKLXyhoN3/InSPwz2ukPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zzT88LKbAJ7FyN0lxruP/0baJHQ5m6YjZQ7dGLYoLtc=; b=t1e1lXdyBTlzxLzeNWiQ3nPdheTGkAO5tDZzkLZm5fC9ZTLTCz3BLeppUZ1luEgTdhJXrY1e81mRWiXmo4PAGf17q+8r1LFKUq1oIei8yQ3mExJyjpXKhLFROXjS1XgVYDibAAS4h0ZRKkwdG77j/wfIoe3noI9bHGIyZlYCTclU/tA4U2Gl5yUZkIZSl5nx8ZjQE2hh2JT4GaXuPGpDWhNNSo6H2UX5cLtEOsjjmT+YN3Wm7EGDFHfZ1AJnIhRAxEgxqLueznNrqP0byBuWCTJXYESBPpqDl9rskdDf9wX1rNYIhkh86cCxBi1jjWrqBMIyQlaBgY7LdLEQYWs6BQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zzT88LKbAJ7FyN0lxruP/0baJHQ5m6YjZQ7dGLYoLtc=; b=g8tToXEaAbJVu8RsKa/TqTBaDiAj3ZKcemtVL+GwtLO4898kQNI8ps0ShPoByrXrVbuzfWFoV2g9AGXCGK/w53pyrD7PoUKM2EVY4a26anTQNwvHEAhA1DsIlHJWWucOW2Z4X8RdkBsCC0PmjjPDVeaoOeS/TI96hi0WADZu0tY= Received: from BN9P220CA0030.NAMP220.PROD.OUTLOOK.COM (2603:10b6:408:13e::35) by CH1PR12MB9693.namprd12.prod.outlook.com (2603:10b6:610:2b0::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.11; Thu, 3 Dec 2026 00:43:33 +0000 Received: from BN1PEPF00018070.namprd04.prod.outlook.com (2603:10b6:408:13e:cafe::3d) by BN9P220CA0030.outlook.office365.com (2603:10b6:408:13e::35) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.10 via Frontend Transport; Thu, 3 Dec 2026 00:43:33 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by BN1PEPF00018070.mail.protection.outlook.com (10.167.245.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Thu, 3 Dec 2026 00:43:33 +0000 Received: from BELBCREELEY01.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Wed, 2 Dec 2026 18:43:32 -0600 From: Brett Creeley Subject: [PATCH RFC 0/3] PCI: Allow a device more time for its link to return after a reset Date: Wed, 2 Dec 2026 16:43:25 -0800 Message-ID: <20261202-b4-pci-link-up-timeout-v1-0-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="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAC27EGsC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIzNDIKGbZKJbkJypm5OZl61bWqBbkpmbml9aomtgnmaempRsaWpuYq4E1Fx QlJqWWQE2OFopyM1ZKRYiWFyalJWaXAIyUqm2FgB8LbfffwAAAA== X-Change-ID: 20261202-b4-pci-link-up-timeout-07f7ebc95747 To: Bjorn Helgaas CC: , , Lukas Wunner , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Eric Joyner , "Nikhil P. Rao" , Brett Creeley X-Mailer: b4 0.15.2 X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00018070:EE_|CH1PR12MB9693:EE_ X-MS-Office365-Filtering-Correlation-Id: 7df3a909-a30d-41eb-d873-08df50d67563 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|23010399003|1800799024|82310400026|376014|261022075727099003|56012099006|10067099003|261026140227099003|261021121427099003|261026121527099003|261021135927099003|261021123027099003|261022105027099003|261028144727099003|261102123227099003|261009223027099003|18002099003|11063799006|5023799004|6133799003|13003099007; X-Microsoft-Antispam-Message-Info: b5cDAQ1e/QPEzeSWD5LsmXfBa1mycSCbAQOb1rbpItFsri/HpKsZy7CclqQx7+HMvorT6Gpdg5vu1pD31Zx4TQDL456KofxY2n39OlFaQDtl3t4h65nW8zti0sR82frvKDsV5cGm+AQcXPbpYGW7b+IBd5TCFB5WnSZOBgGhES1xKmvuKL+uySfsg/CqKK/UJODhDviiwjYb/CoTNBGNscLbz5ojhJ7F7cJqnIrIXQRlbPBopocqDdpZbEYpl7yPH5AX8RF8G1nxFkSiSkCwRwIIJJwAc+U2wFkGG9x4ZZs5GRbF7k5rAsJAJOGlko2OMxXCLYFh3ccCIpp3YCyUVs96wUCZbD1VYxku74tNpaKfq0zxSuLd6q1i2cZ9NZSHLOjyDNgxVne4VRwR7E0nhrXOjcA+2GFxnq5iBJNfaNXhFVa7H0zY5UMZcNrGDUBhBnT6KUG1hTodADDkscgXRRUYU0mgXSv5n8AMqv8rYVSThP+une962VoN1myBaWkYmnkI+PxDm2ZUt1vroqR2e76UXLZAol0Le5++exns3I10snhMo8zIum0/9tw7KT5hhggf5AX5wI4suVr8W7IphJHsUatyEs3+Bc0Guk+ltHZ7F2iygUd0L/IVsiiZtV4+IoGisxyhZWtzrHhAQp7a+w== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700016)(23010399003)(1800799024)(82310400026)(376014)(261022075727099003)(56012099006)(10067099003)(261026140227099003)(261021121427099003)(261026121527099003)(261021135927099003)(261021123027099003)(261022105027099003)(261028144727099003)(261102123227099003)(261009223027099003)(18002099003)(11063799006)(5023799004)(6133799003)(13003099007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: e1AV0BR5IcZn9HSn1uN7B+3FpY+/dZhemCPu/xsJeOiBRFPnrma/T1CAG+5fe2hGU4+u9i/dC7eFfteTAqYehvqm69xOgv+vKzOeaVKwqN4oi/hsL6oTzF1vWDFkzi/dX3mkQgsxkdMbVto1wRnj7pbe8/4kxbW5VIB2WOiiT/QwJLgkQptA65RhXU1UgQb7fNmEU0gWZc+mltBubHUk8TYYmqYnEIG25MTY8/BV/PooTApjNyn/fd7TYa2cJDBnA92SbE5mLn9WLcgDewakmFkHKJ9oqE4XlSQ0JmRUU8tntrXwWAfGefD00po0CEEUBAWhcomcAqeeEVk46TFNzrs6ZCuKRhQuG8GXi5uaAcdsnTEYzOheMdXBvaTqHVKrKaUNnnlV3KQCY1hb54+Rmp8iEIG0dH/UYFGR6VcREZFM+qNDA1jxom4iFIN31YSQ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2026 00:43:33.2102 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7df3a909-a30d-41eb-d873-08df50d67563 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF00018070.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH1PR12MB9693 When the SoC of an AMD Pensando Vulcano 800 AI NIC is reset, for example when the card's management controller power-cycles it after a fatal error, its link stays down for up to ~12 seconds. The Root Port sees a Surprise Down and DPC contains the port, but after releasing DPC, pci_bridge_wait_for_secondary_bus() waits only 1 s for the link to come back. Recovery fails and the card is disconnected, even though it would have returned. In the power-cycle case the card is unpowered for most of the outage, so its firmware cannot keep the link up. PCIe r5.0 sec 6.6.1 requires that, within 1.0 s of a Conventional Reset, a device can receive a Configuration Request and return a Successful Completion, independent of how quickly link training completes. A link that is still down after ~12 s cannot meet that, so this is handled as a device erratum. The Readiness Time Reporting Extended Capability cannot express it: its times are capped at about 1.006 s and only shorten the spec-mandated waits. This follows Lukas' suggestion that hardware which doesn't meet the spec gets a quirk that raises the timeout for that device, rather than a blanket increase [1]. Patch 1 adds PCI_VENDOR_ID_PENSANDO to pci_ids.h. Patch 2 adds pci_dev->link_up_timeout, which a quirk can set. When waiting for the secondary bus after a reset, the core uses the largest value of the devices on that bus. The value lives in the child's struct pci_dev, so it is still available while the device's config space is unreachable during DPC. Devices without the quirk keep the existing 1 s timeout. Ports at or below 5 GT/s, and ports without link active reporting (which can only sleep, not poll), are unchanged. This complements d3cold_delay rather than duplicating it: on this path d3cold_delay is the wait after the link is up, before the device is accessed, whereas link_up_timeout bounds how long the link may take to come up in the first place. Patch 3 sets 20 s for the Vulcano upstream port. Questions for this RFC: - Is a device quirk the right place for this, rather than having the device's driver set the value at probe? A quirk covers the card even when no driver is bound to its functions, and it is set before any driver probes. - Should the core cap link_up_timeout (e.g. at PCIE_RESET_READY_POLL_MS), or is the quirk's value trusted as is? - Hotplug-capable slots are not handled yet. Vulcano cards are deployed in slots that support hotplug, and there pciehp waits only 4 s in pci_dpc_recovered() for DPC recovery before treating the Link Down as a removal, so a ~12 s outage still ends in the card being torn down. That wait covers the DPC recovery which, with this series, already includes link_up_timeout, so one possible approach is to reuse the same field: have pci_dpc_recovered() extend its 4 s by the amount a quirked device below the port adds to the link-up wait, leaving other devices unchanged. Bjorn has suggested instead that this wait match PCIE_RESET_READY_POLL_MS for everyone [2]. Which would you prefer? This part is not implemented or tested yet. - Ports at or below 5 GT/s still use the fixed 1 s budget. Is it worth extending that path too, or is it fine to leave it until a device needs it? Testing: on systems with a Vulcano 800 AI NIC in slots without hotplug, resetting the card's SoC keeps the link down for ~12 s. Without this series, DPC recovery fails and the card is disconnected; with it, the link returns within the extended wait and DPC recovery succeeds. [1] https://lore.kernel.org/linux-pci/awIScN3rXFv6v9x2@wunner.de/ [2] https://lore.kernel.org/linux-pci/20250806213409.GA19037@bhelgaas/ Signed-off-by: Brett Creeley --- Brett Creeley (3): PCI: Add PCI_VENDOR_ID_PENSANDO PCI: Allow quirks to extend the link-up wait after reset PCI: Extend link-up timeout for AMD Pensando Vulcano upstream port drivers/pci/pci.c | 73 +++++++++++++++++++++++++++++++++++++++++-------- drivers/pci/quirks.c | 13 +++++++++ include/linux/pci.h | 1 + include/linux/pci_ids.h | 2 ++ 4 files changed, 78 insertions(+), 11 deletions(-) --- base-commit: 85a0cf7926b9e6883cbc515b8b5f77090d3b1889 change-id: 20261202-b4-pci-link-up-timeout-07f7ebc95747 Best regards, -- Brett Creeley