Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1257543rwi; Thu, 27 Oct 2022 13:23:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Q27Jc4vYCMneGyqNNcXfhZwEMJ5d8p2C+lXEsQ8LKUOktraCnmgjjx2TLL2l6Upi69VX1 X-Received: by 2002:a63:8643:0:b0:46b:2bef:338b with SMTP id x64-20020a638643000000b0046b2bef338bmr43722735pgd.357.1666902199255; Thu, 27 Oct 2022 13:23:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666902199; cv=none; d=google.com; s=arc-20160816; b=vAhlgV0IB7aNPQvulwUZu0g8XqCscTPQkDezlcWfwykS+ZMvUWkyI/mfQaU9eOCUbA oxJmgl5ZKpH9EBk/23oU+UuE7SoPTLBe2yYThFfbGul/sS0cJxZ8obCVcKLkNogmZjFs UhlqS/NkrevcqYZEETiXcEPK2wVoeA++cVCDDxHakfBjYBTAaxKYlYxsONTvp1ALuaQr 96Ng/AI5i+r2w4/Z0y+RMn9wkWkAWo91B1W9jBdYkb+F6rd187lXzJMUDJfxHg/p33pD DTnpPxPm8qxTjlb7PVhU5TFicNVrLNPD96ycqAt23hJcd7PP9hmAbcwQ0UMSvdfV+ZXs BQyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=d+819bBKV2/hQ0v9OQ2O/TeAoWwLXmcETC4PNPsgypA=; b=BnA8A7HQFRgg22iSMmTvWRRIUKBHk8E0LUs6wgSFBsoqiaueu60djEIPLrBmRcYNH6 wpXV6mpZ9D6tv1IXcscloSCDx3p+/CiVhMxN9aC7xcwKKBPu/5tx1V6xh7IrE3OoO25k WuRW9OuuEUwvNtejqd2q5MRY14+OoxYLI4mLrY6lacETXQ+9fiUJAHYikbywThpRT0Zs 8zz3JcoLvI+Wce/V9UCAHlrwkV6FPgyyeAXnWFnXpjVJQA3YgIohqB7fGbb0eQc+yNB+ JGjWgbDawnVc1nCKHz8tIEKD+IoP6/IKe/x/pgufSPG23MdVnzXmXeUVs7uzpT2MTlxs tH0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BunQq78l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b10-20020a170903228a00b0016f1eb1317esi2890840plh.471.2022.10.27.13.23.07; Thu, 27 Oct 2022 13:23:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BunQq78l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236896AbiJ0USF (ORCPT + 99 others); Thu, 27 Oct 2022 16:18:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236842AbiJ0USB (ORCPT ); Thu, 27 Oct 2022 16:18:01 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7B5A8C00C; Thu, 27 Oct 2022 13:17:59 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id a13so4827014edj.0; Thu, 27 Oct 2022 13:17:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=d+819bBKV2/hQ0v9OQ2O/TeAoWwLXmcETC4PNPsgypA=; b=BunQq78l9VTK1Voqc+Y0JwFPL/g8lhX4GKaIX1Z11ETFNhjfapo0cCtRFr77xIQbDC tRyPdhJGzGYK1svZWGPAzfeqzogBi1sy9ARqB/BjAmAyJTgYfPaYfjEAYVM1uvOkxJar djulsWBPVbPRs+MinE7gkmWtI/5+B+3x0LQEgB4mHLmzLaAn+Uiwd3R9NJmrRwkqV045 S9HhTTgndJcAQGgmr00gT0wkN4hH4u+bDushJZiS3+0PmMROXi7F+h7xCkkQV6NWXLF0 8yyx1zlA8+lcDSGn8hOD5Kmt7NVtdWJwsSNNX5v7EL9xW8BwLjsqJI0aqxopgONpAcZ/ Bwhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=d+819bBKV2/hQ0v9OQ2O/TeAoWwLXmcETC4PNPsgypA=; b=cKQ3w0YG5SdjNl0QtRuVcRjT0eIoraGBfOo114XEL+4zETzp9WztbJzNr5ar6EZDqN fUsIrKElZLIegG6kEVpffBlUud6/H26MGCxvKqteRmvlguiry5i9V+X+4j5EUdbDuQIO cUQPUeEzF4r3+S/ZATAOdk43Zq71goalMSql0rlAqGMMcMlz0WJxRnaGtctAU9eMBRZx hFRKCjkYRRP57UL4KLX0U0kqum8j+XA5zKu70gGdpQuAFYGRGLnhOhRDOLhiU11p3gXk lX/esju7+YXKeBidzJYeT5Rl9RKkwQx2yPtexjKkDvHzgOn0j+zAWtW1KpfaYjh3NTWt wmBg== X-Gm-Message-State: ACrzQf3Ure5Fc8yDwwHaU3cMkxjB9HLuaVryrDAISrh75QFHsEa0wMC8 SthJDv2Ghc+qIfl/I3jY5zYtUKeoYY8eJogJcC8= X-Received: by 2002:a05:6402:3890:b0:45c:2b5:b622 with SMTP id fd16-20020a056402389000b0045c02b5b622mr48258784edb.69.1666901878347; Thu, 27 Oct 2022 13:17:58 -0700 (PDT) MIME-Version: 1.0 References: <20220919143340.4527-1-vidyas@nvidia.com> <20220919143340.4527-3-vidyas@nvidia.com> In-Reply-To: From: Han Jingoo Date: Thu, 27 Oct 2022 13:17:46 -0700 Message-ID: Subject: Re: [PATCH V1 2/2] PCI: designware-ep: Disable PTM capabilities for EP mode To: Lorenzo Pieralisi Cc: Vidya Sagar , gustavo.pimentel@synopsys.com, robh@kernel.org, kw@linux.com, bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, kthota@nvidia.com, mmaddireddy@nvidia.com, sagar.tv@gmail.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 27, 2022 Lorenzo Pieralisi wrote: > > On Mon, Sep 19, 2022 at 08:03:40PM +0530, Vidya Sagar wrote: > > Dual mode DesignWare PCIe IP has PTM capability enabled (if supported) even > > in the EP mode. The PCIe compliance for the EP mode expects PTM > > capabilities (ROOT_CAPABLE, RES_CAPABLE, CLK_GRAN) be disabled. > > Hence disable PTM for the EP mode. > > "PCIe compliance" - what is this referring to ? Hi Lorenzo, You can refer to the following link: https://pcisig.com/developers/compliance-program PCIe compliance means 'PCIe Compliance test "Compliance tests allow for product testing against PCI-SIG test modules". Usually, USB specs and PCIe specs define compliance tests where product manufacturers need to pass specific test procedures. For example, in USB cases, USB.org says that "To qualify for the right to display the certified USB logo in conjunction with a product, the product must pass USB-IF compliance testing for product quality." To Vidiya, If my understanding is not correct, please let us know what you intended. > > Was this reported to Synopsys ? To Vidiya, Would you confirm that? Thank you. Best regards, Jingoo Han > > Thanks, > Lorenzo > > > Signed-off-by: Vidya Sagar > > --- > > .../pci/controller/dwc/pcie-designware-ep.c | 19 ++++++++++++++++++- > > 1 file changed, 18 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c > > index 7e9529ae3824..dc3057b18f36 100644 > > --- a/drivers/pci/controller/dwc/pcie-designware-ep.c > > +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c > > @@ -646,7 +646,7 @@ int dw_pcie_ep_init_complete(struct dw_pcie_ep *ep) > > struct dw_pcie_ep_func *ep_func; > > struct device *dev = pci->dev; > > struct pci_epc *epc = ep->epc; > > - unsigned int offset; > > + unsigned int offset, ptm_cap_base; > > unsigned int nbars; > > u8 hdr_type; > > u8 func_no; > > @@ -698,6 +698,7 @@ int dw_pcie_ep_init_complete(struct dw_pcie_ep *ep) > > } > > > > offset = dw_pcie_ep_find_ext_capability(pci, PCI_EXT_CAP_ID_REBAR); > > + ptm_cap_base = dw_pcie_ep_find_ext_capability(pci, PCI_EXT_CAP_ID_PTM); > > > > dw_pcie_dbi_ro_wr_en(pci); > > > > @@ -710,6 +711,22 @@ int dw_pcie_ep_init_complete(struct dw_pcie_ep *ep) > > dw_pcie_writel_dbi(pci, offset + PCI_REBAR_CAP, 0x0); > > } > > > > + /* > > + * PTM responder capability can be disabled only after disabling > > + * PTM root capability. > > + */ > > + if (ptm_cap_base) { > > + dw_pcie_dbi_ro_wr_en(pci); > > + reg = dw_pcie_readl_dbi(pci, ptm_cap_base + PCI_PTM_CAP); > > + reg &= ~PCI_PTM_CAP_ROOT; > > + dw_pcie_writel_dbi(pci, ptm_cap_base + PCI_PTM_CAP, reg); > > + > > + reg = dw_pcie_readl_dbi(pci, ptm_cap_base + PCI_PTM_CAP); > > + reg &= ~(PCI_PTM_CAP_RES | PCI_PTM_GRANULARITY_MASK); > > + dw_pcie_writel_dbi(pci, ptm_cap_base + PCI_PTM_CAP, reg); > > + dw_pcie_dbi_ro_wr_dis(pci); > > + } > > + > > dw_pcie_setup(pci); > > dw_pcie_dbi_ro_wr_dis(pci); > > > > -- > > 2.17.1 > >