Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp891164rdb; Wed, 6 Dec 2023 03:01:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IFBMxJWYuEXBK6eE0GWdU2GSpTfHVblhY+CPC8gry6X9jXaAFuL7lTWZLDQ55XEoEZHEU0h X-Received: by 2002:a05:6a00:98e:b0:6cd:faa6:fc4b with SMTP id u14-20020a056a00098e00b006cdfaa6fc4bmr865061pfg.33.1701860498024; Wed, 06 Dec 2023 03:01:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701860498; cv=none; d=google.com; s=arc-20160816; b=ucemTc7azLenBxE77pEOSimoWEd6JcgODmIeByiFq/gOVbmulc6yvpmVwI20sQ1o3J CXQPYIBxEiBZwICecvY2YPLzq5fHGiDE4mypFh5y/jaA1nsnOyRbWwSD8wguNUT245vA PFoao8pX/RUvooevYDPCBAVqRNaGew1ySidc59Z99UktfwJzMzNc3O4WKAtc+q+FmRR4 Q2pJeRReSZRFEkFzNF4G3eE0rVP2RJn/xWDyHZjwdZm99KBxJejCNn/JdmPcgo9Id7Rs I+RrDva90IT0VoxotLVAK9rPNl0eBsO5tNpD8Kj9uWsxVzJqiUp43q5/AnXHe11nCtgA JAlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=6mwXRBpwXtVljtnkFQGiVIC86aQ+9jGrwtUsw8dxUnU=; fh=ld3UXb1S5Y4IkunPfuj6e9Ppmc+fy6ncC+eQtrVLfK8=; b=ITsfg6OdYkFKDFyFF9v6laE5FmmBY9x3iPA2iK2etNvu44HbaYpyr7wHJw03E2VQNm VCpZajbtyY7+alzN5dL//D87l+dQT61IcGoAh9eaaCkqdPufYqS19vPmCOOXqlMK8lht pv9ybzXhR9I2QkXj8MFQFD3qum9vmKLBHgHBMPGbbWiZqrWiJ7we0pW1O8EXvleTIUo8 zrZeaTQ6Tc0MI1alMteReuwuHNvwZRiGo6C4q1TvsDibkJR+j/4Bz3O72nwhnLZzgdLT wNNO8hzwx80mkfwYkdLnn9sN1Wt5Kk5y1dPtFjqMPpMy4/GXgDYdGIY/ghfTq0uSPJHD c/vg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id c12-20020a63da0c000000b00564c67e66fbsi11378328pgh.842.2023.12.06.03.01.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 03:01:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id CE7DF826E3AA; Wed, 6 Dec 2023 03:01:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378043AbjLFLA3 (ORCPT + 99 others); Wed, 6 Dec 2023 06:00:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378039AbjLFK7f (ORCPT ); Wed, 6 Dec 2023 05:59:35 -0500 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C910D10F1; Wed, 6 Dec 2023 02:59:11 -0800 (PST) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id AFA7880ED; Wed, 6 Dec 2023 18:58:59 +0800 (CST) Received: from EXMBX171.cuchost.com (172.16.6.91) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 6 Dec 2023 18:58:59 +0800 Received: from ubuntu.localdomain (183.27.97.199) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 6 Dec 2023 18:58:58 +0800 From: Minda Chen To: Conor Dooley , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Lorenzo Pieralisi , "Daire McNamara" , Emil Renner Berthing , Krzysztof Kozlowski CC: , , , , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie , Minda Chen Subject: [PATCH v12 19/21] PCI: Add PCIE_RESET_CONFIG_DEVICE_WAIT_MS waiting time value Date: Wed, 6 Dec 2023 18:58:37 +0800 Message-ID: <20231206105839.25805-20-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231206105839.25805-1-minda.chen@starfivetech.com> References: <20231206105839.25805-1-minda.chen@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [183.27.97.199] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) To EXMBX171.cuchost.com (172.16.6.91) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 06 Dec 2023 03:01:25 -0800 (PST) From: Kevin Xie Add the PCIE_RESET_CONFIG_DEVICE_WAIT_MS macro to define the minimum waiting time between exit from a conventional reset and sending the first configuration request to the device. As described in PCI base specification r6.0, section 6.6.1 , there are two different use cases of the value: - "With a Downstream Port that does not support Link speeds greater than 5.0 GT/s, software must wait a minimum of 100 ms following exit from a Conventional Reset before sending a Configuration Request to the device immediately below that Port." - "With a Downstream Port that supports Link speeds greater than 5.0 GT/s, software must wait a minimum of 100 ms after Link training completes before sending a Configuration Request to the device immediately below that Port." Signed-off-by: Kevin Xie Reviewed-by: Mason Huo --- drivers/pci/pci.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 5ecbcf041179..06f1f1eb878c 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -22,6 +22,22 @@ */ #define PCIE_PME_TO_L2_TIMEOUT_US 10000 +/* + * As described in PCI base specification r6.0, section 6.6.1 , there are two different use cases of the value: + * + * - "With a Downstream Port that does not support Link speeds greater + * than 5.0 GT/s, software must wait a minimum of 100 ms following exit + * from a Conventional Reset before sending a Configuration Request to + * the device immediately below that Port." + * + * - "With a Downstream Port that supports Link speeds greater than + * 5.0 GT/s, software must wait a minimum of 100 ms after Link training + * completes before sending a Configuration Request to the device + * immediately below that Port." + */ +#define PCIE_RESET_CONFIG_DEVICE_WAIT_MS 100 + extern const unsigned char pcie_link_speed[]; extern bool pci_early_dump; -- 2.17.1