Message ID | 20231124014508.43358-1-kevin.xie@starfivetech.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp834146vqx; Thu, 23 Nov 2023 17:46:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IGG6gpU9OFC/TX1fPbEnsbs14G7TB56TRdN0e3++kdahgdTN6Fg9Tm3XwIqhIfcpRIy29pW X-Received: by 2002:a05:6a20:12d3:b0:154:b4cb:2e8c with SMTP id v19-20020a056a2012d300b00154b4cb2e8cmr1573469pzg.24.1700790402968; Thu, 23 Nov 2023 17:46:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700790402; cv=none; d=google.com; s=arc-20160816; b=dpTvakS9ZEYt2nOEA14l+dW78Rrn5CvVXohXK8bl6LjcxVILmduziIXN0C/dG3csHq yon/eZpx7NsdACf8+61StFsWxwQt9y7mvW1Gp1xI5ZiMoBhB7461Mgcbom0kgY+j+Jfy CFubcnsEm6BMOLLeb4n9gneU6PSp9g2Xd3aPoQAgDyoNaHzj21l7XcXYUv2M49D36t+z Dm5umbHv3nEKMhGjptB9prT8i1zEjfara8sS56uuFmm+ojhVe4fIgC+lN4F6TEf5kyT2 dXd+G8RnOFafTbP6Vksv50YYTsdATKS2JgU3PW3QKS/8opwBgqODXM7i+MYCcGxOTP02 vz2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Eky3Ops2ODoE8pFBZEzLwPpk0+demCm2/D8+uMNDivY=; fh=ePpz6gvppFWh9C0DxkD4pTg2CDnQY/Bg6s/Ea+lZqVI=; b=U16uxVCIH6A5+v6iA0INjjZEteT3bPVrvD+HtdvjMEhmJfuwBMlIpesrG40fHj2wdD P0SEvJsiuAk3qXxeMW0KXIQEcIfp2lI/V2qnXAf9Hn4LRlu4evRSFo1RIdgBfa0livQP 2cVnzhHTTDFG6boF1ywp94XIhrzMmNLq9sPeeZCpUvN0rX8obL6UVVOfE/erf509YwnZ fHmfjpuyA0H5GLMJY/P01fIvY3xZdKXKLvGf/7PAzhsm4hHGbBaoUl8HczE0//aksNix 0QN4ZDEzWcD7o/I5uu5KS77MBO/B/7PNNOVQGBnRPViehoeRrRzUDrEfqIisJ5y5rAuL WmyA== 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:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id l4-20020a17090ac58400b0027d30e575ccsi2465997pjt.115.2023.11.23.17.46.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 17:46:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 5CFA283642B1; Thu, 23 Nov 2023 17:45:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230174AbjKXBpW convert rfc822-to-8bit (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Thu, 23 Nov 2023 20:45:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjKXBpT (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 23 Nov 2023 20:45:19 -0500 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E31B10C7; Thu, 23 Nov 2023 17:45:22 -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 ex01.ufhost.com (Postfix) with ESMTP id C27C924E245; Fri, 24 Nov 2023 09:45:14 +0800 (CST) Received: from EXMBX172.cuchost.com (172.16.6.92) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 24 Nov 2023 09:45:14 +0800 Received: from kevin-ThinkStation-P340.starfivetech.com (113.72.144.198) by EXMBX172.cuchost.com (172.16.6.92) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 24 Nov 2023 09:45:13 +0800 From: Kevin Xie <kevin.xie@starfivetech.com> To: Bjorn Helgaas <bhelgaas@google.com> CC: <linux-pci@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <mason.huo@starfivetech.com>, <leyfoon.tan@starfivetech.com>, <minda.chen@starfivetech.com> Subject: [PATCH v1] PCI: Add PCIE_CONFIG_REQUEST_WAIT_MS waiting time value Date: Fri, 24 Nov 2023 09:45:08 +0800 Message-ID: <20231124014508.43358-1-kevin.xie@starfivetech.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [113.72.144.198] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) To EXMBX172.cuchost.com (172.16.6.92) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: 8BIT 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 groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 23 Nov 2023 17:45:48 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783407997417540449 X-GMAIL-MSGID: 1783407997417540449 |
Series |
[v1] PCI: Add PCIE_CONFIG_REQUEST_WAIT_MS waiting time value
|
|
Commit Message
Kevin Xie
Nov. 24, 2023, 1:45 a.m. UTC
Add the PCIE_CONFIG_REQUEST_WAIT_MS marco to define the minimum waiting time between sending the first configuration request to the device and exit from a conventional reset (or after link training completes). As described in the conventional reset rules of PCI specifications, there are two different use cases of the value: - With a downstream port that supports link speeds <= 5.0 GT/s, the waiting is following exit from a conventional reset. - With a downstream port that supports link speeds > 5.0 GT/s, the waiting is after link training completes. Signed-off-by: Kevin Xie <kevin.xie@starfivetech.com> Reviewed-by: Mason Huo <mason.huo@starfivetech.com> --- drivers/pci/pci.h | 7 +++++++ 1 file changed, 7 insertions(+)
Comments
On Fri, Nov 24, 2023 at 09:45:08AM +0800, Kevin Xie wrote: > Add the PCIE_CONFIG_REQUEST_WAIT_MS marco to define the minimum waiting > time between sending the first configuration request to the device and > exit from a conventional reset (or after link training completes). s/marco/macro/ List the first event before the second one, i.e., the delay is from exit from reset to the config request. > As described in the conventional reset rules of PCI specifications, > there are two different use cases of the value: > > - With a downstream port that supports link speeds <= 5.0 GT/s, > the waiting is following exit from a conventional reset. > > - With a downstream port that supports link speeds > 5.0 GT/s, > the waiting is after link training completes. Include the spec citation here as well as in the comment below. I assume there are follow-on patches that actually use this? Can we make this the first patch in a series so we know we don't have an unused macro lying around? > Signed-off-by: Kevin Xie <kevin.xie@starfivetech.com> > Reviewed-by: Mason Huo <mason.huo@starfivetech.com> > --- > drivers/pci/pci.h | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h > index 5ecbcf041179..4ca8766e546e 100644 > --- a/drivers/pci/pci.h > +++ b/drivers/pci/pci.h > @@ -22,6 +22,13 @@ > */ > #define PCIE_PME_TO_L2_TIMEOUT_US 10000 > > +/* > + * PCIe r6.0, sec 6.6.1, <Conventional Reset> > + * Requires a minimum waiting of 100ms before sending a configuration > + * request to the device. > + */ > +#define PCIE_CONFIG_REQUEST_WAIT_MS 100 > + > extern const unsigned char pcie_link_speed[]; > extern bool pci_early_dump; > > -- > 2.25.1 >
On Fri, Nov 24, 2023 at 09:45:08AM +0800, Kevin Xie wrote: > Add the PCIE_CONFIG_REQUEST_WAIT_MS marco to define the minimum waiting > time between sending the first configuration request to the device and > exit from a conventional reset (or after link training completes). > > As described in the conventional reset rules of PCI specifications, > there are two different use cases of the value: > > - With a downstream port that supports link speeds <= 5.0 GT/s, > the waiting is following exit from a conventional reset. > > - With a downstream port that supports link speeds > 5.0 GT/s, > the waiting is after link training completes. > > Signed-off-by: Kevin Xie <kevin.xie@starfivetech.com> > Reviewed-by: Mason Huo <mason.huo@starfivetech.com> > --- > drivers/pci/pci.h | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h > index 5ecbcf041179..4ca8766e546e 100644 > --- a/drivers/pci/pci.h > +++ b/drivers/pci/pci.h > @@ -22,6 +22,13 @@ > */ > #define PCIE_PME_TO_L2_TIMEOUT_US 10000 > > +/* > + * PCIe r6.0, sec 6.6.1, <Conventional Reset> > + * Requires a minimum waiting of 100ms before sending a configuration > + * request to the device. > + */ > +#define PCIE_CONFIG_REQUEST_WAIT_MS 100 Oh, and I think this name should include something about "reset" because that's the common scenario and that's the spec section where the value is mentioned.
On 2023/11/30 7:21, Bjorn Helgaas wrote: > On Fri, Nov 24, 2023 at 09:45:08AM +0800, Kevin Xie wrote: >> Add the PCIE_CONFIG_REQUEST_WAIT_MS marco to define the minimum waiting >> time between sending the first configuration request to the device and >> exit from a conventional reset (or after link training completes). > > s/marco/macro/ > > List the first event before the second one, i.e., the delay is from > exit from reset to the config request. > OK,I will use "from A to B" instead of "between A and B". >> As described in the conventional reset rules of PCI specifications, >> there are two different use cases of the value: >> >> - With a downstream port that supports link speeds <= 5.0 GT/s, >> the waiting is following exit from a conventional reset. >> >> - With a downstream port that supports link speeds > 5.0 GT/s, >> the waiting is after link training completes. > > Include the spec citation here as well as in the comment below. > OK, I will include the spec citation here. > I assume there are follow-on patches that actually use this? Can we > make this the first patch in a series so we know we don't have an > unused macro lying around? > Yes, we will use the marco in the next version of our PCIe controller patches. Here is the link of current version patch series: https://lore.kernel.org/lkml/20231115114912.71448-20-minda.chen@starfivetech.com/T/#u Do you mean that I should put this patch back to the above series as one of the separate patches? Thanks for your review. >> Signed-off-by: Kevin Xie <kevin.xie@starfivetech.com> >> Reviewed-by: Mason Huo <mason.huo@starfivetech.com> >> --- >> drivers/pci/pci.h | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h >> index 5ecbcf041179..4ca8766e546e 100644 >> --- a/drivers/pci/pci.h >> +++ b/drivers/pci/pci.h >> @@ -22,6 +22,13 @@ >> */ >> #define PCIE_PME_TO_L2_TIMEOUT_US 10000 >> >> +/* >> + * PCIe r6.0, sec 6.6.1, <Conventional Reset> >> + * Requires a minimum waiting of 100ms before sending a configuration >> + * request to the device. >> + */ >> +#define PCIE_CONFIG_REQUEST_WAIT_MS 100 >> + >> extern const unsigned char pcie_link_speed[]; >> extern bool pci_early_dump; >> >> -- >> 2.25.1 >>
On 2023/11/30 7:22, Bjorn Helgaas wrote: > On Fri, Nov 24, 2023 at 09:45:08AM +0800, Kevin Xie wrote: >> Add the PCIE_CONFIG_REQUEST_WAIT_MS marco to define the minimum waiting >> time between sending the first configuration request to the device and >> exit from a conventional reset (or after link training completes). >> >> As described in the conventional reset rules of PCI specifications, >> there are two different use cases of the value: >> >> - With a downstream port that supports link speeds <= 5.0 GT/s, >> the waiting is following exit from a conventional reset. >> >> - With a downstream port that supports link speeds > 5.0 GT/s, >> the waiting is after link training completes. >> >> Signed-off-by: Kevin Xie <kevin.xie@starfivetech.com> >> Reviewed-by: Mason Huo <mason.huo@starfivetech.com> >> --- >> drivers/pci/pci.h | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h >> index 5ecbcf041179..4ca8766e546e 100644 >> --- a/drivers/pci/pci.h >> +++ b/drivers/pci/pci.h >> @@ -22,6 +22,13 @@ >> */ >> #define PCIE_PME_TO_L2_TIMEOUT_US 10000 >> >> +/* >> + * PCIe r6.0, sec 6.6.1, <Conventional Reset> >> + * Requires a minimum waiting of 100ms before sending a configuration >> + * request to the device. >> + */ >> +#define PCIE_CONFIG_REQUEST_WAIT_MS 100 > > Oh, and I think this name should include something about "reset" > because that's the common scenario and that's the spec section where > the value is mentioned. Agree, how about PCIE_RESET_CONFIG_DEVICE_WAIT_MS?
On Thu, Nov 30, 2023 at 06:03:55PM +0800, Kevin Xie wrote: > On 2023/11/30 7:21, Bjorn Helgaas wrote: > > On Fri, Nov 24, 2023 at 09:45:08AM +0800, Kevin Xie wrote: > >> Add the PCIE_CONFIG_REQUEST_WAIT_MS marco to define the minimum waiting > >> time between sending the first configuration request to the device and > >> exit from a conventional reset (or after link training completes). > > > > s/marco/macro/ > > > > List the first event before the second one, i.e., the delay is from > > exit from reset to the config request. > > OK,I will use "from A to B" instead of "between A and B". That's not my point. My point was you said "between B (config request) and A (exit from reset)". "A" happens first, so it should be mentioned first. > > I assume there are follow-on patches that actually use this? Can we > > make this the first patch in a series so we know we don't have an > > unused macro lying around? > > Yes, we will use the marco in the next version of our PCIe controller patches. > Here is the link of current version patch series: > https://lore.kernel.org/lkml/20231115114912.71448-20-minda.chen@starfivetech.com/T/#u > > Do you mean that I should put this patch back to the above series as > one of the separate patches? Yes, please. Handling them as a group is less overhead and helps avoid merge issues (if they're all in a series there's no possibility that the user gets merged before the macro itself). Bjorn
On 2023/12/1 2:35, Bjorn Helgaas wrote: > On Thu, Nov 30, 2023 at 06:03:55PM +0800, Kevin Xie wrote: >> On 2023/11/30 7:21, Bjorn Helgaas wrote: >> > On Fri, Nov 24, 2023 at 09:45:08AM +0800, Kevin Xie wrote: >> >> Add the PCIE_CONFIG_REQUEST_WAIT_MS marco to define the minimum waiting >> >> time between sending the first configuration request to the device and >> >> exit from a conventional reset (or after link training completes). >> > >> > s/marco/macro/ >> > >> > List the first event before the second one, i.e., the delay is from >> > exit from reset to the config request. >> >> OK,I will use "from A to B" instead of "between A and B". > > That's not my point. > > My point was you said "between B (config request) and A (exit from > reset)". "A" happens first, so it should be mentioned first. > Got it. >> > I assume there are follow-on patches that actually use this? Can we >> > make this the first patch in a series so we know we don't have an >> > unused macro lying around? >> >> Yes, we will use the marco in the next version of our PCIe controller patches. >> Here is the link of current version patch series: >> https://lore.kernel.org/lkml/20231115114912.71448-20-minda.chen@starfivetech.com/T/#u >> >> Do you mean that I should put this patch back to the above series as >> one of the separate patches? > > Yes, please. Handling them as a group is less overhead and helps > avoid merge issues (if they're all in a series there's no possibility > that the user gets merged before the macro itself). > OK, I will put the patch back with these changes. > Bjorn
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 5ecbcf041179..4ca8766e546e 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -22,6 +22,13 @@ */ #define PCIE_PME_TO_L2_TIMEOUT_US 10000 +/* + * PCIe r6.0, sec 6.6.1, <Conventional Reset> + * Requires a minimum waiting of 100ms before sending a configuration + * request to the device. + */ +#define PCIE_CONFIG_REQUEST_WAIT_MS 100 + extern const unsigned char pcie_link_speed[]; extern bool pci_early_dump;