Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4357539pxf; Tue, 30 Mar 2021 06:06:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4XV/40mn7QQsK+bbCP1aubaS9y+TQ4ZHF6LmGGXlFN1ErAnQJniH5Wm47dfkuT4uyQaDJ X-Received: by 2002:a17:906:cb87:: with SMTP id mf7mr32566060ejb.81.1617109561993; Tue, 30 Mar 2021 06:06:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617109561; cv=none; d=google.com; s=arc-20160816; b=Kxwl/e2CepUIz0icw5v2GLmpyMSFiSTm4ww00exeLAbKha+6e/W5m5qmmd4qZng65k jESwPF00wCOKmTw/zILAVrGuTzDpbrL+4cFMGa8o5UNnyjvWOqHA6zDFCsoMaNC81Ud/ qs8VTVti3Fbt5XwhMgPM3AvKsN5Vdj9rCHR1DpEicYzSXJc6nznoe1ZgDabdWEnrWr6T UnlSIqFZEHV7MpnlfCcjNIQvHPTS3TMhtvVopAtv2u7ppsbwqnycb5onCM7R9l5rU6qG soH8Eyx9ZuWwyEzxhmV2HlmoPro6Tb0BSnHGHLtMZXs+geJc3Z3u0bNI4dQNxYo5jWVy SXlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=2Fo2+AnlXY3YGKuNrx9+doIl98kdioBTsh1a8Hbm7rg=; b=vWkUeyr7MfR/bAaZVNBXV55De/1gawU67HtGMT+vph7GD6jofrG8QyamjUOrf/5dGP xMaZj4CILB+4jOPHd2KllgI9tFZWLCctmW3DBa+7eJ+wvy1p7FAXKDHCe9wdiR+D+Y/p kAgtZXOsRfBo6JN+VASlnfe8Falr5/z+WoZXlIXr22LKfaUwvzfefXT2q1ursPm2cuIr pNkuDJKQHjrRJtU8C/+f3BpnzoqSPLSCE2/hcgP5eLElipBRCym1+6pbn1cpD3f8Cxdp 47NqXxtYhqrpGI5MVBafo7KWTeRH0IrZCub90LQ0q5l5QIa1hXc5YGoAHwsP89ol7e/G CFdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t14si15018053ejr.191.2021.03.30.06.05.38; Tue, 30 Mar 2021 06:06:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232135AbhC3NEK (ORCPT + 99 others); Tue, 30 Mar 2021 09:04:10 -0400 Received: from angie.orcam.me.uk ([157.25.102.26]:38172 "EHLO angie.orcam.me.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231574AbhC3NED (ORCPT ); Tue, 30 Mar 2021 09:04:03 -0400 Received: by angie.orcam.me.uk (Postfix, from userid 500) id 619B692009C; Tue, 30 Mar 2021 15:04:02 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 5EC2092009B; Tue, 30 Mar 2021 15:04:02 +0200 (CEST) Date: Tue, 30 Mar 2021 15:04:02 +0200 (CEST) From: "Maciej W. Rozycki" To: David Laight cc: 'Amey Narkhede' , =?UTF-8?Q?Pali_Roh=C3=A1r?= , "alex.williamson@redhat.com" , "helgaas@kernel.org" , "lorenzo.pieralisi@arm.com" , "kabel@kernel.org" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "raphael.norwitz@nutanix.com" Subject: RE: How long should be PCIe card in Warm Reset state? In-Reply-To: Message-ID: References: <20210310110535.zh4pnn4vpmvzwl5q@pali> <20210323161941.gim6msj3ruu3flnf@archlinux> <20210323162747.tscfovntsy7uk5bk@pali> <20210323165749.retjprjgdj7seoan@archlinux> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Mar 2021, David Laight wrote: > I can't see the value in the (nice bound) copy of the PCI 2.0 spec I have. > But IIRC it is 100ms (it might just me 500ms). > While this might seem like ages it can be problematic if targets have > to load large FPGA images from serial EEPROMs. AFAICT it is 100ms for the Conventional Reset before Configuration Requests are allowed to be issued in the first place, and then they are allowed to fail with the Configuration Request Retry Status (CRS) status until the device is ready to respond. Then it is 1.0s before the Root Complex and/or system software is allowed to consider a device broken that does not return a Successful Completion status for a valid Configuration Request. This 1.0s period is analogous to the Trhfa parameter for PCI/PCI-X buses (2^25/2^27 bus clocks respectively; I don't know why the PCIe spec quotes the latter value as 2^26, contrary to what the original PCI-X spec says, but obviously the latter document is what sets the norm), which also has to be respected for the respective bus segments in the presence of PCIe to PCI/PCI-X bridges. For Function-level reset the timeout is 100ms. This is specified in sections 6.6.1. "Conventional Reset" and 6.6.2. "Function-Level Reset (FLR)" respectively in the copy of PCIe 2.0 base spec I have access to; I imagine other versions may have different section numbers, but will have them named similarly. If I were to implement this stuff, for good measure I'd give it a safety margin beyond what the spec requires and use a timeout of say 2-4s while actively querying the status of the device. The values given in the spec are only the minimum requirements. HTH, Maciej