Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4931782rdh; Wed, 29 Nov 2023 15:21:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFYvHbuOLi2WuXgTVcSkPc3ubvoEDBTe9ddLdi94DZ9uwI3F/Ptn4IQEdW7xmgvP9037fv4 X-Received: by 2002:a17:903:32ce:b0:1cf:c989:4922 with SMTP id i14-20020a17090332ce00b001cfc9894922mr11076652plr.63.1701300080185; Wed, 29 Nov 2023 15:21:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701300080; cv=none; d=google.com; s=arc-20160816; b=Xq0p8hHLZj+oPbzI/w5nZ/839U6hDVe9L4QodaIeJDActu8gJMLAEEuRAvVD95P/A1 a5ZuogmdYRo3+4DfqmlQrgcwIH4ttVYOUsG+qxoN1MG9L2oOxyUwJ42bkBVDszqh69Nr mi/rVsxqUCeqhC+N5sd4OpJMVSMFDT0HO4RC/5/u0Gx69HYh+Is/k3aqg9B3OcUhTdpt xNVImT01y3EXwWIgbMuQrc0mRy11RzYQHHY9vaDpK//8vKKE++NgztiYMqXUB6Dsv2T0 6p4jE+i8ANlOaD862HvQNX7z1yemY0aMecDvOfnSIyeA1WAssN1NqC7bx1OFlqKul+Jp Fteg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=u5Ulrusgc7FARoeCo4fF2VbgwD0goOooOJ7yG6gGSRM=; fh=cN/WNadKQ17Ve9nvb1w5HqEJy5EVJl/bACIsnLZBQh0=; b=QkHQEAH6/PSAjrNmMTAC5wbuxrfhZbuZHeYTjAepMHWJ8YdFvANGSFpsFqMHt09Jhd FFp7QnysZvZZGtNED8WcY6R83r5kdzcQ614HHR9hU2cjIcu0oFYfn8mvfmlLflaxUX6Y 9iPNBDEcQb/D2lHb9ZVAQUety51Q+IZ3P/82TEI/WWd2VEx1ZA4tKuMB++wFt2PPojro Axfug7MlJPJfg3lDsl3j8BdSk5QieUU7I72Uy39G99RJVthK2WJXsANNZydssU/6ITi8 r5RAnPgD2AVTgel7CtuEfjohxMMTePxIqr0WIGWvyxStYSyZwV9lzMN4kbBKacjH5E5E AW0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mkrHl0UL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id ix13-20020a170902f80d00b001cfb29b9c0bsi10540900plb.161.2023.11.29.15.21.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 15:21:20 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mkrHl0UL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id C3EC58043AE0; Wed, 29 Nov 2023 15:21:17 -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 S229658AbjK2XVF (ORCPT + 99 others); Wed, 29 Nov 2023 18:21:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229611AbjK2XVD (ORCPT ); Wed, 29 Nov 2023 18:21:03 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A606A2 for ; Wed, 29 Nov 2023 15:21:10 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC51FC433C7; Wed, 29 Nov 2023 23:21:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701300070; bh=9rdUMQCjtMr+ri5NEp2KYKHprcR+lytmbQP/lABcO2o=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=mkrHl0ULby81el9Tdi5wmgCfn8mVc0JBY/qTBKFuTKOV/yj+7U6oroEKfKUzCOved 68JatSVY8amXrxWOwXp8yrL7A+igA0ZVNVPNlQnoxAdWFAzfJYZZ/yRKafewoP1fwh Y7xdcggF8W5NWZFsbkbhnxj+t4zN/BLubFTqUQoPyZRD95PTbdjRkRv0QMKNisyNua NxZDw+rSP2x2atemkcLccbIEpl7JvhS7iyNJn7QmPR7nwxpiRQStzFpyjPPIF/f0O2 enVW6eVuZbJzypOGsxMn9opRGLvyLVUg2eZn6tmaEZBqZWekXrFB81eKVM2OCdeN5R KwJHqnTYXk8Hg== Date: Wed, 29 Nov 2023 17:21:08 -0600 From: Bjorn Helgaas To: Kevin Xie Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, mason.huo@starfivetech.com, leyfoon.tan@starfivetech.com, minda.chen@starfivetech.com Subject: Re: [PATCH v1] PCI: Add PCIE_CONFIG_REQUEST_WAIT_MS waiting time value Message-ID: <20231129232108.GA444155@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231124014508.43358-1-kevin.xie@starfivetech.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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, 29 Nov 2023 15:21:17 -0800 (PST) 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 > Reviewed-by: Mason Huo > --- > 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, > + * 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 >