From patchwork Thu Dec 14 07:28: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: 178537 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8374195dys; Wed, 13 Dec 2023 23:31:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IE5glTlT+eiC3mzYvqAt6PzyXDJpubP6KtE7FS4SVXFS0/BbppYZuiIGjxKqVmo0E1evrSK X-Received: by 2002:a05:6870:8e0a:b0:1fa:f51f:e4e0 with SMTP id lw10-20020a0568708e0a00b001faf51fe4e0mr12978781oab.21.1702539099032; Wed, 13 Dec 2023 23:31:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702539098; cv=none; d=google.com; s=arc-20160816; b=sN9iWD93ucxBHxIJBVGsXbhnjW4rT8tpYKJ4W2voYmFyBtWeLgVPfV+enJNtceRla3 gIIadvu9dXSNs74XqBAimbuCQfgIDrF3q+IHnhioro13ravps4kvCkTvjPBIehD8LC5U X5VSZdWVQQrGcmTQN2EaknzbwfxJE7r7cVj6Qxj3VZuV55MSfIlkCoOJMScgGDrNefl3 gPhlbCtW613AC+FxwhOhMMWfHuneXtp4qM9MR4QxTfmPYEWscXV2G2xPVduy+E/6+xQe 9Kh47/USkCUaiTUD8CPVrGUhsXE7qFBe/KMdX9QfH4mdyChE1HhRwRscjcE3Y1dW0aIt 4UcQ== 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=Ylj9w+xdnBL8dk75p/VVGP4kmbcpM4tFwsiJpbK4hx4MAgqdgRxIsdYW1fua4fuyn9 xzfsHYxd71zZEjBGi+adswRcwx8dP0atOLyYvtRvYNfacCX7+pKU1H8kJmU3uwbfoR8W LE7nCa+w/sEfqK4kbZeL8FLmpk43U8N9eeY6kMTxTORHe2o4KJMLMFWkwu90M6fHxYRa NXU1C/BDdHSL7hWbJr+q1HXW+kURkvDoI/mBcne7rKXJTJFe7kCj+5Dj1Zt6xOAtd4lA 0L7hoI9TlIVzaDXsmtSyEZVYcQPijBQnxCiplad+yRjMLNm5vPR7JeehVIhyAEdpn40V cKAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id k16-20020a63d850000000b005740b4723f9si10831717pgj.811.2023.12.13.23.31.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 23:31:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 601808027F58; Wed, 13 Dec 2023 23:31:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443402AbjLNHaz (ORCPT + 99 others); Thu, 14 Dec 2023 02:30:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443415AbjLNHaX (ORCPT ); Thu, 14 Dec 2023 02:30:23 -0500 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAC4C1734; Wed, 13 Dec 2023 23:29:50 -0800 (PST) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 6514C8175; Thu, 14 Dec 2023 15:29:49 +0800 (CST) Received: from EXMBX171.cuchost.com (172.16.6.91) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 14 Dec 2023 15:29:49 +0800 Received: from ubuntu.localdomain (113.72.145.168) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 14 Dec 2023 15:29:47 +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 v13 19/21] PCI: Add PCIE_RESET_CONFIG_DEVICE_WAIT_MS waiting time value Date: Thu, 14 Dec 2023 15:28:37 +0800 Message-ID: <20231214072839.2367-20-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231214072839.2367-1-minda.chen@starfivetech.com> References: <20231214072839.2367-1-minda.chen@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [113.72.145.168] X-ClientProxiedBy: EXCAS064.cuchost.com (172.16.6.24) 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 agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 13 Dec 2023 23:31:20 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785241638341846890 X-GMAIL-MSGID: 1785241638341846890 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 Acked-by: Bjorn Helgaas --- 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;