Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp872120lqe; Sun, 7 Apr 2024 07:39:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVz9uG5fDFIuevh3W7X6xzXdQclEENLBdmIWqEw/WuzE/DNZE6wxCSfc+Sbj9p/febV9aEGLnQ95s825laAFAcLZ8kxN78X7+CegUvJwA== X-Google-Smtp-Source: AGHT+IFq+J0cKhu2hGfwJ8w7WV+J/YFD+rtUgA7jzNtJUeRj7U50E5EtjnpbWZ36gqdzYE/cr7fn X-Received: by 2002:a05:6214:3015:b0:699:c93:6752 with SMTP id ke21-20020a056214301500b006990c936752mr10158291qvb.11.1712500764474; Sun, 07 Apr 2024 07:39:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712500764; cv=pass; d=google.com; s=arc-20160816; b=yRr4DHx21NEIz7r0IxE1Gw6UjQwExTYTmVskxGDzAMmyVOOJTYx+laFW8TNfQARmpR cDgmMUL4dtqKriLv6yNTLTUjisA0EzuNiwQUMDNuXwF1r9YBNPH2hub1P1wH7l9AMHbU dz/FhGW3QKQYObDu7meSxrEncgQ3SgN8XUPZr3IiB7GpPtwMtBxJuozDKfv9OOqB7vCU KalFj6BFSQg60m3VdALsjcejc+CBbYOVulz7J5VGjsffC91LvfxIrgw5HCMMNzVQwtB0 W5PBdkn2DubYKisX+FEvSo1mLS8V5yGO6txNwgnJwllJSlU1ZuCS+d59Y5QJl2gs3NvT I0Ow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2LZAkncASPlbpc6367WngJVqse7xUjgqmkXpizfuBKM=; fh=6i7vSHvSeHORc/qBDS0EKUMBT6N4ddeWevHPP57Vw7k=; b=ntA1/jh3U8olQ0X3JdonGvFePXqu2Oq70EABxqS9hLuGmLjMBBif8bcr8waOnaYSvg wXy9k5Y4JgOZAy0Z/+X7rWuK2Pj4XZsisKEyaxHPbH3e/zCPWMj3Bwao+lfSKx0FwYuu yAatotL2fwRWvshKCsGuTJTe2p4PgmndTJrMnnF8RjS2/NMHkIUxyv5jyAd9FWP7w5UB DrQvCXnn2+81SVO1Smz9ULJqHcSS3pXnwi04r+hfojToc2Z17hInF1otoRws2VQCw8Qh 9UpX3Hy06s5kZVRQHaWMzpRn3qew2fAWF7oVI3QwMEkPnhEdNxUf5zpHsJ9feh5TllFg JmqQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p5cOR3Wc; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-134523-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134523-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c8-20020a0cfb08000000b0069b15c08caesi1239032qvp.587.2024.04.07.07.39.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Apr 2024 07:39:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-134523-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p5cOR3Wc; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-134523-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134523-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 298FD1C210D1 for ; Sun, 7 Apr 2024 14:39:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9622A38DD3; Sun, 7 Apr 2024 14:39:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="p5cOR3Wc" Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 05E0D3987C for ; Sun, 7 Apr 2024 14:39:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712500753; cv=none; b=AqMGDeEFk1HbJ6BjwgnV2aaLmkYCFhDWHip+L4SHiat6vE7xnh/MJs3nTZn7hyhHboCXIccolhitjC+B4K3Cm34F9VeWeXSvHxE2RgzL5fiL50byeeibJNeHVsizh5hyIXPQf/BU9Wx5VsaKnUmmVcsEoDHeUKWUAPlACvdbM1c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712500753; c=relaxed/simple; bh=DJnwqYbsLyjNn7qo99swGBX4/CjBa9OD5NsKwZAE1EQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ql6nNHPBdGVepx7UUCRLlSl52qRuq7TC73DkiXctXfdth1kxIVo1WzIHeCsLY+x4UXR6izkDe2PDq4yF+NMufAqXLrMMA73KDaxPDzTM7zk/u+xqlMClMqzso0KunMowcWhRvGiv107WXZHHUcNfFaJ49luXUJi63HYIKl7Z3VM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=p5cOR3Wc; arc=none smtp.client-ip=209.85.210.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-6ecf8ebff50so1987930b3a.1 for ; Sun, 07 Apr 2024 07:39:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712500751; x=1713105551; 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=2LZAkncASPlbpc6367WngJVqse7xUjgqmkXpizfuBKM=; b=p5cOR3WcDYZ8WgXnFiOpyEAuahR1KnqSV9DMjrJRKknehQOoi7eRqmYi/qUvhjal7Q Hciy9SeapGS6i7h2Vi18V5/opKgZyD8F6x+Hr62whyhmTwIjeOwTxbGOc9sJIP7KA98s pmrNYLkpJEYWj54qJFkstMZjWfvlz3YCIqKS4l9jRSohxzzDnNymVcTAkH07UAH+QIra qObzyYFfJdBjHe8ZHyGSamxTcWoTGxLCwdFmuF4vkEjSF3ZnLLHkgbgoyKeCgVKuz9y2 8MMv2KeQjU8kGCb+vilckAje8FjU3zFmwP6vxgcHeZioTr/RF2tQE+LDfbdrY71HX9f6 3aaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712500751; x=1713105551; 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=2LZAkncASPlbpc6367WngJVqse7xUjgqmkXpizfuBKM=; b=bXHc1FozgPT1W1DCt2cBi52RACIf9R5J0sTFQx8WZwzT6JVwEUCXXwWBZd7pogMBy/ GrPXcZyTZdrr7gW0rCk89+fhUiCShIAZiu97LRIjRb8rUB8dKhF6vKFh1QOWlvWOwXWq kk8A+Jy0YdoAdYIUmISC7wh2QzkL6T3Qx7OspGGCjuLX9Ycb/Vb8XpU5HrldfDRPMV27 AWAfC1nT7hF8ziYtVXy/5pofeYdG8sRNMjdBM/pMBa+rmC6OvrnGR1q1EExgKJPfoxnR Zhnm9op95vsackD4jm/vjqwQN2J3x6vhfmI1Coex6mChkuu4rXtXnCu3tzk/2hxiVMBY nPmg== X-Forwarded-Encrypted: i=1; AJvYcCWFofTqI7jFg+PLRHotFOkkTcY2HJB+qTvQuQ76N0K5wmJqBSxeDjmddnuB4AhVunFPweGxKNOzwKwNrMdl6KAFRcYmLI7O6xZlySHM X-Gm-Message-State: AOJu0YwJ/VQUkt1loAExjSSQd/AtRJaCiRXq0x/8p//gfORU/f8/nJSD E3hvoLlHPDa8lqXq+qcgLBV5+DHLIlJ/vaD9btykRZD+sskiB6keElXfnI5HAg== X-Received: by 2002:a05:6a00:1951:b0:6ea:c7bd:90e3 with SMTP id s17-20020a056a00195100b006eac7bd90e3mr8901015pfk.14.1712500751028; Sun, 07 Apr 2024 07:39:11 -0700 (PDT) Received: from thinkpad ([120.56.192.184]) by smtp.gmail.com with ESMTPSA id p11-20020a056a000a0b00b006eacefd8fabsm4722117pfh.64.2024.04.07.07.39.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Apr 2024 07:39:10 -0700 (PDT) Date: Sun, 7 Apr 2024 20:09:02 +0530 From: Manivannan Sadhasivam To: Krishna chaitanya chundru Cc: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Bjorn Helgaas , johan+linaro@kernel.org, bmasney@redhat.com, djakov@kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, vireshk@kernel.org, quic_vbadigan@quicinc.com, quic_skananth@quicinc.com, quic_nitegupt@quicinc.com, quic_parass@quicinc.com, krzysztof.kozlowski@linaro.org, Bryan O'Donoghue Subject: Re: [PATCH v9 2/6] PCI: qcom: Add ICC bandwidth vote for CPU to PCIe path Message-ID: <20240407143902.GB2679@thinkpad> References: <20240407-opp_support-v9-0-496184dc45d7@quicinc.com> <20240407-opp_support-v9-2-496184dc45d7@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240407-opp_support-v9-2-496184dc45d7@quicinc.com> On Sun, Apr 07, 2024 at 10:07:35AM +0530, Krishna chaitanya chundru wrote: > To access PCIe registers, PCIe BAR space, config space the CPU-PCIe Please specify whether you are referencing PCIe host controller or endpoint device or both. > ICC (interconnect consumers) path should be voted otherwise it may ICC is just 'Interconnect' unless I misunderstood. > lead to NoC (Network on chip) timeout. We are surviving because of > other driver vote for this path. > s/vote/voting > As there is less access on this path compared to PCIe to mem path > add minimum vote i.e 1KBps bandwidth always which is recommended > by HW team. > 'which is sufficient enough to keep the path active.' > When suspending, disable this path after register space access > is done. > > Reviewed-by: Bryan O'Donoghue > Signed-off-by: Krishna chaitanya chundru > --- > drivers/pci/controller/dwc/pcie-qcom.c | 38 ++++++++++++++++++++++++++++++---- > 1 file changed, 34 insertions(+), 4 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c > index 14772edcf0d3..b4893214b2d3 100644 > --- a/drivers/pci/controller/dwc/pcie-qcom.c > +++ b/drivers/pci/controller/dwc/pcie-qcom.c > @@ -245,6 +245,7 @@ struct qcom_pcie { > struct phy *phy; > struct gpio_desc *reset; > struct icc_path *icc_mem; > + struct icc_path *icc_cpu; > const struct qcom_pcie_cfg *cfg; > struct dentry *debugfs; > bool suspended; > @@ -1409,6 +1410,9 @@ static int qcom_pcie_icc_init(struct qcom_pcie *pcie) > if (IS_ERR(pcie->icc_mem)) > return PTR_ERR(pcie->icc_mem); > > + pcie->icc_cpu = devm_of_icc_get(pci->dev, "cpu-pcie"); > + if (IS_ERR(pcie->icc_cpu)) > + return PTR_ERR(pcie->icc_cpu); > /* > * Some Qualcomm platforms require interconnect bandwidth constraints > * to be set before enabling interconnect clocks. > @@ -1418,7 +1422,19 @@ static int qcom_pcie_icc_init(struct qcom_pcie *pcie) > */ > ret = icc_set_bw(pcie->icc_mem, 0, QCOM_PCIE_LINK_SPEED_TO_BW(1)); > if (ret) { > - dev_err(pci->dev, "failed to set interconnect bandwidth: %d\n", > + dev_err(pci->dev, "failed to set interconnect bandwidth for PCIe-MEM: %d\n", > + ret); > + return ret; > + } > + > + /* > + * Since the CPU-PCIe path is only used for activities like register Again, differentiate PCIe controller and endpoint device access. > + * access, Config/BAR space access, HW team has recommended to use a > + * minimal bandwidth of 1KBps just to keep the link active. > + */ > + ret = icc_set_bw(pcie->icc_cpu, 0, kBps_to_icc(1)); > + if (ret) { > + dev_err(pci->dev, "failed to set interconnect bandwidth for CPU-PCIe: %d\n", > ret); > return ret; > } > @@ -1448,7 +1464,7 @@ static void qcom_pcie_icc_update(struct qcom_pcie *pcie) > > ret = icc_set_bw(pcie->icc_mem, 0, width * QCOM_PCIE_LINK_SPEED_TO_BW(speed)); > if (ret) { > - dev_err(pci->dev, "failed to set interconnect bandwidth: %d\n", > + dev_err(pci->dev, "failed to set interconnect bandwidth for PCIe-MEM: %d\n", > ret); > } > } > @@ -1610,7 +1626,7 @@ static int qcom_pcie_suspend_noirq(struct device *dev) > */ > ret = icc_set_bw(pcie->icc_mem, 0, kBps_to_icc(1)); > if (ret) { > - dev_err(dev, "Failed to set interconnect bandwidth: %d\n", ret); > + dev_err(dev, "Failed to set interconnect bandwidth for PCIe-MEM: %d\n", ret); > return ret; > } > > @@ -1634,7 +1650,15 @@ static int qcom_pcie_suspend_noirq(struct device *dev) > pcie->suspended = true; > } > > - return 0; > + /* > + * Remove the vote for CPU-PCIe path now, since at this point onwards, > + * no register access will be done. > + */ Are you sure? Didn't we see late access to DBI registers on sc7280? > + ret = icc_disable(pcie->icc_cpu); > + if (ret) > + dev_err(dev, "failed to disable icc path of CPU-PCIe: %d\n", ret); s/failed to disable icc path/Failed to disable Interconnect path between CPU-PCIe > + > + return ret; > } > > static int qcom_pcie_resume_noirq(struct device *dev) > @@ -1642,6 +1666,12 @@ static int qcom_pcie_resume_noirq(struct device *dev) > struct qcom_pcie *pcie = dev_get_drvdata(dev); > int ret; > > + ret = icc_enable(pcie->icc_cpu); > + if (ret) { > + dev_err(dev, "failed to enable icc path of CPU-PCIe: %d\n", ret); Same as above. - Mani -- மணிவண்ணன் சதாசிவம்