From patchwork Wed Dec 6 10:58:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minda Chen X-Patchwork-Id: 174503 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4025223vqy; Wed, 6 Dec 2023 03:01:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IGNpm8jeOWFCJ23DFGPQL0899lA0TYoKPj5AcxZpiTi9JYQs57h+vI5WdUT2XVQTE0+aJ9G X-Received: by 2002:a17:90b:94e:b0:287:731b:cf9 with SMTP id dw14-20020a17090b094e00b00287731b0cf9mr685955pjb.34.1701860501055; Wed, 06 Dec 2023 03:01:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701860501; cv=none; d=google.com; s=arc-20160816; b=Gq4VbFY128IFTeTkE0hAyAAl2V39OVY2g5Z1rDy+GEx/9SDi+qHXWIKrvBTZtwEuo+ yvHvHn3nJeHHhBeaCZxjiSENUAhjApEv3Y3H8yohK04c6WwbqkGJVt1ICR+mVkgMuaRo U1I69yL/xKaLsunpHeZLRIuMgRf6Ot95VRWDRyCTTGjtC0taQwJ6Z8W0is3KN3x24pQH wekGsamWsHbC7d55k2C4G1+9WpQQiTODkb+sk9EQSC0v2jDlfVJQj9NcXv7dE521iRWX ppPzf2lG4v3C7yKhFAz9Uc5ylSJVU/uMBqeuDSuG8PvXeiQivTXdG4G3YUUEhNpPJOLX sTMQ== 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 Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id il6-20020a17090b164600b002747da1ef66si11470489pjb.53.2023.12.06.03.01.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 03:01:41 -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 B26EC826E3B5; Wed, 6 Dec 2023 03:01:11 -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_Wilczy=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 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:14 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784530077154387051 X-GMAIL-MSGID: 1784530077154387051 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;