Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2994355rdh; Wed, 27 Sep 2023 21:59:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2EGqbAteTV3Q1Hb43SZB5HVEJeka2RBHEXzLBAUd80zGch4wpHHfmScQXB42QhNsB9gSV X-Received: by 2002:a17:902:d481:b0:1b6:a37a:65b7 with SMTP id c1-20020a170902d48100b001b6a37a65b7mr470975plg.23.1695877195250; Wed, 27 Sep 2023 21:59:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695877195; cv=none; d=google.com; s=arc-20160816; b=g+TFwLLDGHmh+1Qlhpki/DhrdNjVwFPURcaIH8zCeeW8TnU2s4M/zvwifJyf68eR64 ZD27xxaJ2qYoGBOjHInlIf5BJ6T7cq+Nw6GqSUgoxcwVjvCnkZvYgDykoNbWWnLNhnrZ v7t8IaFcAQwk/Po1QyWjBu05+TE6NkgySek7PQaYkYM3QE5remaIc3iHVuJmYuZ4s7Um g2EwgzFWF7PZ1KJpWgXrD59Pq06yyUnWpO3BduQuOAMteYYatf853oXOXlnlwIEsdPj1 4H229AFM0bytE+Qaf/1cyk3zmVUGGamSfDY8xWbv1lZHvGPE+biWMKf0mC4ObguKd4bG d3WA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=9pyRPFM/sI4rOWP+tRGMK/egiWElrb+QbrVYo7Uy96U=; fh=6Rf9bqzdi9P/pDPF62zWRIRAu1QnmwcBTFlgEdO870w=; b=s80d+NEw4u/56pjGa0XwC/9P0GYz+lUpIpyCcR/DUruWT1NEZx5ybddTYvDSdKm1HU ghQEIeOshvd78amI5z450vOdmCnRhQTUg4maL6GuL0HqFbTn3+gAJYlK47EO74j9Pz/3 jlJVsMeY+jc2zAT9sMqHtx6yIBUpNiFPy7sb0rYX4VPb/QLcH6ZE0vtJ7Ug64BXAezor 1Ki7w550QDgtN3g9EUPM3hvgS1m2x3Si3x3veGfkE++x9y85Ludfw5qU7fpAAgVCgEpA cIIHwPpztFX4zkGdqdeO9mfoH7p73rWztxqKK5T59HoysZrzbI8Fhm2wznQ+Z85WheSq i/zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K5zwiUkz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id j185-20020a638bc2000000b00563f8ccc097si17869285pge.780.2023.09.27.21.59.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 21:59:55 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=K5zwiUkz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id DF1A681BC4B4; Wed, 27 Sep 2023 06:05:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231378AbjI0NFD (ORCPT + 99 others); Wed, 27 Sep 2023 09:05:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231760AbjI0NFB (ORCPT ); Wed, 27 Sep 2023 09:05:01 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32612136 for ; Wed, 27 Sep 2023 06:04:59 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-9ada2e6e75fso1473657366b.2 for ; Wed, 27 Sep 2023 06:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695819897; x=1696424697; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=9pyRPFM/sI4rOWP+tRGMK/egiWElrb+QbrVYo7Uy96U=; b=K5zwiUkznYW0Dkup4+sMUjtwyjdkWBlFOGt9mxLy1bexbUEDWHG79+I41thZL6wL+E k/VRLN6LhHBddV4h+8bDNaE/f2h2e0ho16whPt2Rad/H+t02vmDdRIPl35SdpxtF+QIU FHbZC2pGUzI7xD8jj2Qej05ON7/MSV47mzooKFmLwTojbs0gkky9UMkMhMmpALwgdryo VZE9jagFiqXDy/hM+oUmQNLMhrA2meSH02mmxY4CCNRXngNfFPK9GrGcPPJYpvhfyjpU tHpMB/sal8MNRHEDdK9nXk/QMmW5h/9k4V8eJdPNrktzAqC9rXvU8Z1rM23XpCOUSXYw KJFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695819897; x=1696424697; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9pyRPFM/sI4rOWP+tRGMK/egiWElrb+QbrVYo7Uy96U=; b=ov42APqelybgHf5Ookk1yUaJxR9KvcORb18JxthIE7HMitu+/valmwjWzigFy8F+bs r+r/VT5G0w04LMwcmB0ZXBXS3TE55Kl9eWX5nFD8e+FSS2Z1IhhNfSlhUO1OTLCXBIaH koCSi6xUhbQ3q6tc8bBX/fuE4YLi47q4mpMwUJ84c4DncVEZp/sB2av+wsyleszMjHgl nHs+jb4iWHrLCcTjMQjeZJpRcz3cc35osHixva9MdwvGPuD/WjrZ+icLAbSV8GTRVvsd GLMaNw9Jc6sYutpF8veVYI1offvCd2CHuwImlz7DPop7f6azGZnTKl1bWg7w8XEidPvc KxjQ== X-Gm-Message-State: AOJu0YwDaJRQq+yf4fXqsUEBBdww0NNkjt8Yvs3OkFXBkahuafYGKEar yHwP3yjJaKnVUfZjopn/+upA X-Received: by 2002:a17:906:7694:b0:9b2:82d2:a2db with SMTP id o20-20020a170906769400b009b282d2a2dbmr1434401ejm.28.1695819897021; Wed, 27 Sep 2023 06:04:57 -0700 (PDT) Received: from thinkpad ([2a02:2454:9d09:3f00:b024:394e:56d7:d8b4]) by smtp.gmail.com with ESMTPSA id ep14-20020a1709069b4e00b009a168ab6ee2sm8703004ejc.164.2023.09.27.06.04.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 06:04:56 -0700 (PDT) Date: Wed, 27 Sep 2023 15:04:55 +0200 From: Manivannan Sadhasivam To: Bjorn Helgaas Cc: lpieralisi@kernel.org, kw@linux.com, andersson@kernel.org, konrad.dybcio@linaro.org, bhelgaas@google.com, linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, abel.vesa@linaro.org Subject: Re: [PATCH] PCI: qcom: Add interconnect bandwidth for PCIe Gen4 Message-ID: <20230927130455.GB19623@thinkpad> References: <20230924160713.217086-1-manivannan.sadhasivam@linaro.org> <20230926210823.GA427669@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230926210823.GA427669@bhelgaas> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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, 27 Sep 2023 06:05:14 -0700 (PDT) On Tue, Sep 26, 2023 at 04:08:23PM -0500, Bjorn Helgaas wrote: > On Sun, Sep 24, 2023 at 06:07:13PM +0200, Manivannan Sadhasivam wrote: > > PCIe Gen4 supports the interconnect bandwidth of 1969 MBps. So let's add > > the bandwidth support in the driver. Otherwise, the default bandwidth of > > 985 MBps will be used. > > > > Signed-off-by: Manivannan Sadhasivam > > --- > > drivers/pci/controller/dwc/pcie-qcom.c | 7 +++++-- > > 1 file changed, 5 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c > > index 297442c969b6..6853123f92c1 100644 > > --- a/drivers/pci/controller/dwc/pcie-qcom.c > > +++ b/drivers/pci/controller/dwc/pcie-qcom.c > > @@ -1384,11 +1384,14 @@ static void qcom_pcie_icc_update(struct qcom_pcie *pcie) > > case 2: > > bw = MBps_to_icc(500); > > break; > > + case 3: > > + bw = MBps_to_icc(985); > > + break; > > default: > > WARN_ON_ONCE(1); > > fallthrough; > > - case 3: > > - bw = MBps_to_icc(985); > > + case 4: > > + bw = MBps_to_icc(1969); > > The bare numbers here are sort of weird. I assume they correspond to > the Supported Link Speeds Vector in Link Cap 2, and I expected them to > correspond somehow to PCIE_SPEED2MBS_ENC(), which computes the usable > PCIe bandwidth per lane. I see the ratios between 250, 500, 986, 1969 > *do* match up with the ratios of PCIE_SPEED2MBS_ENC() values, but I > don't know the PCIE_SPEED2MBS_ENC() values aren't used: > > SLS Vector PCIE_SPEED2MBS_ENC() > CLS 1: bit 0 2.5 GT/s MBps_to_icc(250) 2000 Mbps > CLS 2: bit 1 5.0 GT/s MBps_to_icc(500) 4000 Mbps > CLS 3: bit 2 8.0 GT/s MBps_to_icc(985) 7879 Mbps > CLS 4: bit 3 16.0 GT/s MBps_to_icc(1969) 15753 Mbps > > This is just my curiosity, probably no change is needed, or at most a > short comment. > You are right. I'm not aware of this macro before and yes, I can make use of it. > I do notice that pcie-qcom-ep.c uses #defines like PCIE_GEN1_BW_MBPS, > and it seems like both could use the same style. > > Also agree with Konrad that the ordering ends up looking unusual; > maybe would be more readable if the default case repeated the speed > you want instead of using the fallthrough. > Yes, that would be more readable. - Mani > > break; > > } -- மணிவண்ணன் சதாசிவம்